Class ProximityOptions
Options for proximity-based search relative to an anchor region.
public sealed class ProximityOptions
- Inheritance
-
ProximityOptions
- Inherited Members
Examples
Example: Find "Total" near a known label region on a page.
using LMKit.Document.Search;
using LMKit.Graphics.Geometry;
var proximity = new ProximityOptions
{
AnchorRegion = new Rectangle(0.6, 0.8, 0.9, 0.9), // Bottom-right area
Radius = 0.05, // 5% of page size
TextOptions = new TextSearchOptions
{
Comparison = StringComparison.OrdinalIgnoreCase,
WholeWord = true
}
};
var engine = new LayoutSearchEngine();
IReadOnlyList<TextRegion> matches = engine.FindNear(page, "Total", proximity);
foreach (TextRegion match in matches)
{
Console.WriteLine($"Found "{match.Snippet}" near the anchor region.");
}
Properties
- AnchorRegion
Region of interest that serves as the proximity anchor.
- Radius
Radius in page units to expand around the anchor region when filtering matches.
- TextOptions
Text matching options used to locate candidate matches prior to proximity filtering.