Highlighter.Net 2.0.0

Highlighter.GetBestFragments Method (TokenStream, String, Int32, String)

Highlights terms in the text , extracting the most relevant sections and concatenating the chosen fragments with a separator (typically "..."). The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned in order as "separator" delimited strings.

public string GetBestFragments(
   TokenStream tokenStream,
   string text,
   int maxNumFragments,
   string separator
);

Parameters

tokenStream
text
text to highlight terms in
maxNumFragments
the maximum number of fragments.
separator
the separator used to intersperse the document fragments (typically "...")

Return Value

highlighted text

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragments Overload List