Table of Contents

Method FindText

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

FindText(PageElement, string, TextSearchOptions)

Finds exact (substring) matches of query within a page's text, honoring textOptions. Results include the matched text, a context snippet, the union bounding box, and contributing elements. Normalization (whitespace/diacritics/optional char-stripping) is applied to both the page text and the query.

public List<TextMatch> FindText(PageElement page, string query, TextSearchOptions textOptions = null)

Parameters

page PageElement

The page to search. Must not be null.

query string

The text to search for. Must not be null.

textOptions TextSearchOptions

Options to control comparison behavior (case, whole word, max results, context size). May be null for defaults.

Returns

List<TextMatch>

An enumeration of TextMatch objects (possibly empty).

Exceptions

ArgumentNullException

Thrown when page or query is null.

FindText(IEnumerable<PageElement>, string, TextSearchOptions)

Finds exact matches across multiple pages and annotates each result with its page index.

public List<TextMatch> FindText(IEnumerable<PageElement> pages, string query, TextSearchOptions textOptions = null)

Parameters

pages IEnumerable<PageElement>

Pages to search. Must not be null.

query string

Text to search for. Must not be null.

textOptions TextSearchOptions

Options to control comparison behavior. May be null for defaults.

Returns

List<TextMatch>

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

Exceptions

ArgumentNullException

Thrown when pages or query is null.