pattern

Purpose

Matches documents containing sequences of arguments in specified order within a sentence, excluding stop-words.

Syntax

pattern([distance, ]term_1, term_2,..)

Arguments
  • The first optional argument distance is used to set the maximum allowed difference between the arguments of the sequence. Its default value is 1.

  • The other arguments define the terms to search for. The function accepts words and phrases in any form, as well as other word or sequence search functions, as arguments.

The function also supports the following optional named parameters:

  • allow_punct:=yes/no regulates whether punctuation marks are allowed within the sequence (set to "yes" by default).

  • allow_space:=yes/no regulates whether spaces are allowed within the sequence (set to "yes" by default).

  • match:=range matches text range from the first found term to the last found term.

Returned Value

Documents matching the query.

Examples

pattern(company, product) matches "the company’s own product mix", "company had a product development process" and "contacted the company with a product complaint".

pattern(2, company, product) matches "the Company’s current products" and "The Company sells its products".

Note

For the function to work correctly, the StopLists dictionary should be enabled in the node settings.

Stop-words are auxiliary words that do not contribute to the meaning of the text («the», «and», «also», «that», «of», etc).