Section navigation

Public classSealed HybridHighlighter

Namespace
Rowles.LeanCorpus.Search.Highlighting
Assembly
Rowles.LeanCorpus.dll

Cascading highlighter that selects the best strategy based on available data.

public sealed class HybridHighlighter : IHighlighter
Inheritance
HybridHighlighter
Implements

Remarks

When term vectors with character offsets are available, delegates to TermVectorHighlighter for phrase-aware, boundary-scanned highlighting without re-analysis.

Otherwise falls back to Highlighter, which re-analyses the stored text with a StandardAnalyser.

Public constructor HybridHighlighter(string, string, IAnalyser?)

Initialises a new HybridHighlighter with the given highlight tags and optional fallback analyser.

Public method GetBestFragment(string, Query, IReadOnlyList<TermVectorEntry>?, int)

Returns the best snippet from text containing highlighted occurrences of the query terms.