tosentence

Purpose

Converts the argument to a sentence it is found in.

Syntax

tosentence($group)

Arguments

Takes one required argument which is a reference to a named group a user wants to format.

The function also takes the following optional named parameters:

Parameter

Comments

match:=range/arguments

If arguments are discontinuous and they are extracted within several sentences, only these sentences appear in the result. When the optional named parameter match:=range is switсhed on, the argument is converted to the whole text fragment from the first sentence till the last one.

first:=<numeral>

If the argument is omitted, the parameter is treated as a range of values. Otherwise, it specifies the offset of the start position.

last:=<numeral>

If the argument is omitted, the parameter is treated as a range of values. Otherwise, it specifies the offset of the end position.

separator:=<string>

The user can indicate a custom separator. If it is not specified, default separator " " (space) is used.

Notes

The parameters first and last may be used independently, without specifying the argument found by a search query.

Returned Value

The returned data type is text.

Examples

tosentence(first:=1, last:=3) converts the result to the first three sentences of the document.

tosentence($m, first:=-1, last:=1) converts the named group $m to one sentence before it and one sentence after it.

tosentence($m, first:=-1, last:=1, match:=range) converts the named group $m to the whole text fragment from the first sentence till the last one, containing one sentence before it and one sentence after it.