Class TextSearchOptions
Options for exact text search.
public sealed class TextSearchOptions
- Inheritance
-
TextSearchOptions
- Inherited Members
Examples
Example: Case-insensitive whole-word search with limited results.
using LMKit.Document.Search;
var textOptions = new TextSearchOptions
{
Comparison = StringComparison.OrdinalIgnoreCase,
WholeWord = true,
MaxResults = 50,
ContextChars = 80
};
var engine = new LayoutSearchEngine();
IReadOnlyList<TextRegion> matches = engine.FindText(page, "invoice", textOptions);
foreach (TextRegion region in matches)
{
Console.WriteLine($"Page {region.PageIndex + 1}: "{region.Snippet}"");
}
Properties
- Comparison
String comparison mode; use OrdinalIgnoreCase for case-insensitive search.
- ContextChars
Number of characters of context to include before and after the match in the snippet.
- MaxResults
Maximum number of matches to return.
- WholeWord
If true, only report matches that are bounded by non-word characters on both sides.