Table of Contents

Class FuzzySearchOptions

Namespace
LMKit.Document.Search
Assembly
LM-Kit.NET.dll

Options for fuzzy search using Levenshtein distance.

public sealed class FuzzySearchOptions
Inheritance
FuzzySearchOptions
Inherited Members

Examples

Example: Find approximate matches for a misspelled word.

using LMKit.Document.Search;

var fuzzyOptions = new FuzzySearchOptions { MaxEditDistance = 2, MinScore = 0.7, TokenAware = true, MaxResults = 30, ContextChars = 60 };

var engine = new LayoutSearchEngine(); IReadOnlyList<TextRegion> matches = engine.FindFuzzy(page, "accomodation", fuzzyOptions);

foreach (TextRegion region in matches) { Console.WriteLine($"Score {region.Score:F2}: "{region.Snippet}""); }

Properties

ContextChars

Number of characters of context to include in the snippet.

MaxEditDistance

Maximum absolute edit distance permitted for a window to qualify as a match.

MaxResults

Maximum number of matches to return.

MinScore

Minimum normalized score (0..1), where 1.0 is an exact match.

TokenAware

When true, discounts whitespace substitution costs.

Share