analyzedText

fun analyzedText(text: String, analyzer: Analyzer, field: String, maxGaps: Int, ordered: Boolean): IntervalsSource

Returns intervals that correspond to tokens from a TokenStream returned for text by applying the provided Analyzer as if text was the content of the given field. The intervals can be ordered or unordered and can have optional gaps inside.

Return

Returns an IntervalsSource that matches tokens acquired from analysis of text. Possibly an empty interval source, never null.

Parameters

text

The text to analyze.

analyzer

The Analyzer to use to acquire a TokenStream which is then converted into intervals.

field

The field text should be parsed as.

maxGaps

Maximum number of allowed gaps between sub-intervals resulting from tokens.

ordered

Whether sub-intervals should enforce token ordering or not.

Throws

IOException

If an I/O exception occurs.


fun analyzedText(tokenStream: TokenStream, maxGaps: Int, ordered: Boolean): IntervalsSource

Returns intervals that correspond to tokens from the provided TokenStream. This is a low-level counterpart to analyzedText. The intervals can be ordered or unordered and can have optional gaps inside.

Return

Returns an IntervalsSource that matches tokens acquired from analysis of text. Possibly an empty interval source, never null.

Parameters

tokenStream

The token stream to produce intervals for. The token stream may be fully or partially consumed after returning from this method.

maxGaps

Maximum number of allowed gaps between sub-intervals resulting from tokens.

ordered

Whether sub-intervals should enforce token ordering or not.

Throws

IOException

If an I/O exception occurs.