Table of Contents

Method FindFuzzy

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

FindFuzzy(PageElement, string, FuzzySearchOptions)

Performs token-aware fuzzy search using Damerau–Levenshtein distance over sliding windows of the page text. Useful when the source contains OCR noise or minor typos. Normalization (whitespace/diacritics/optional char-stripping) is applied to both the page text and the query.

public List<TextMatch> FindFuzzy(PageElement page, string query, FuzzySearchOptions fuzzyOptions = null)

Parameters

page PageElement

The page to search. Must not be null.

query string

The text to locate approximately. Must not be null.

fuzzyOptions FuzzySearchOptions

Fuzzy matching parameters (edit distance, min score, max results, context). May be null for defaults.

Returns

List<TextMatch>

An enumeration of TextMatch objects sorted by descending score (possibly empty).

Exceptions

ArgumentNullException

Thrown when page or query is null.

FindFuzzy(IEnumerable<PageElement>, string, FuzzySearchOptions)

Performs fuzzy search across multiple pages.

public List<TextMatch> FindFuzzy(IEnumerable<PageElement> pages, string query, FuzzySearchOptions fuzzyOptions = null)

Parameters

pages IEnumerable<PageElement>

Pages to search. Must not be null.

query string

Approximate text to locate. Must not be null.

fuzzyOptions FuzzySearchOptions

Fuzzy matching parameters. May be null for defaults.

Returns

List<TextMatch>

All fuzzy matches across pages with (TextMatch) with PageIndex set.

Exceptions

ArgumentNullException

Thrown when pages or query is null.