Search for Repeated Arguments

The function repeat() is used when searching for repeated arguments.

Syntax

repeat([min_repeats, [max_repeats,]] term)

Optional parameters min_repeats and max_repeats set minimum and maximum number of matched repetitions of the argument in the text.

If the parameter max_repeats is absent, the function matches all sequences, containing no less than min_repeats of the argument. If both parameters are absent, the function matches sequences, containing any number of repetitions of the argument.

The function also supports optional named parameters allow_punct and allow_space that regulate whether, correspondingly, punctuation marks and spaces are allowed within the sequence. The parameters take on the following values:

Parameter

Explanation

allow_punct:=yes

Punctuation marks are allowed within the sequence.

allow_punct:=no (default value)

Punctuation marks are not allowed within the sequence.

allow_space:=yes (default value)

Spaces are allowed within the sequence.

allow_space:=no

Spaces are not allowed within the sequence.

Examples

repeat(partofspeech(adjective)) matches «technical service», «concomitant medical products», «multiple solid vertical lines», «recurrent left middle cerebral artery stenosis», etc.

repeat(2, 3, partofspeech(adjective)) matches «concomitant medical products», «multiple solid vertical lines», but not «technical service».

repeat(3, 3, partofspeech(adjective)) matches «multiple solid vertical lines», but not «critical, reliable, real-time data».

repeat(3, 3, partofspeech(adjective), allow_punct:=yes) matches «multiple solid vertical lines» and «critical, reliable, real-time data».

repeat(3, partofspeech(adjective)) matches «multiple solid vertical lines», «recurrent left middle cerebral artery stenosis», etc.