line

Purpose

Finds documents within the specified number of rows.

Syntax

line([lines_number, ] [term_1] [, term_2])

Arguments

This function has no required arguments. When called without arguments, the function matches all lines.

  • The first optional argument lines_number is used to specify maximum number of rows. The default value is 1.

  • The other arguments define the terms to search for.

The function also supports optional named parameters:

  • whole:=yes which extracts whole lines made up by the arguments contained in the query.

  • match:=arguments extracts only the arguments listed inside the function (default value).

  • 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.

  • min_length sets the minimal line’s length in tokens.

  • max_length sets the maximal line’s length in tokens.

Note

The line() function ignores empty lines between arguments.

Returned Value

Documents matching the query.

Examples

line(3, group, "full name") matches all mentions of the words "group" and "full name" within three lines of a text, ignoring empty lines between them.

line(reason, to, buy, whole:=yes) matches only the lines containing all arguments of the query (reason, to, buy).

line(thing, min_length:=2, max_length:=10) matches all mentions of the word "thing" in a line containing from 2 to 10 tokens.

line(budget, match:=range) matches a whole line containing the word "budget".

line(not cat) matches the lines not containing the word "cat".

line(company, match:=inverse) matches the lines containing the word "company" and highlights the whole line except for the word "company".