sentence

Purpose

Matches documents which contain arguments within specified number of sentences.

Syntax

sentence([number,] [term_1,] [term_2,…​])

Arguments

This function has no required arguments. When called without arguments, the function matches all sentences. The function accepts several arguments:

  1. The first optional argument number sets the number of sentences. The default value is 1.

  2. The second and the following arguments are the terms to be searched for; the number of them is unlimited; the order of them is not important.

The function also supports optional named parameters:

  • allow_punct:=yes/no allows or prohibits punctuation between arguments (set to "yes" by default).

  • allow_space:=yes/no allows or prohibits spaces between arguments (set to "no" by default).

  • match:=range matches text range starting from the first found term and ending with the last found term.

  • match:=inverse matches text range starting from the first found term and ending with the last found term except for the specified arguments.

  • match:=first/last/shortest/longest matches the first/last/shortest/longest sentence.

  • whole:=yes matches sentences made up only by the arguments listed in the query.

Returned Value

Documents matching the query.

Examples

sentence(company, project) matches "The company also is moving forward with an enterprise data warehouse project" and "The cost of the project is estimated at $3.6 billion, the companies said".

sentence(not project) matches the sentences not containing the word "project".

sentence(lemma(noun, share), up or down) matches documents which contains information about positive or negative share rates dynamics within a sentence in any order: "Lagardere shares were up 0.1 percent at 0819GMT", "European shares closed down 0.9 percent".

sentence(teva, cut, job) matches "Teva cuts 1,000 jobs across US and Europe" and "Teva cuts jobs".

sentence(teva, cut, job, whole:=yes) matches "Teva cuts jobs".

sentence(amount, match:=inverse) matches all sentences containing the word "amount" and highlights the whole sentence except for the word "amount".