Class BetweenOptions
Options for extracting text between two textual anchors.
public sealed class BetweenOptions
- Inheritance
-
BetweenOptions
- Inherited Members
Examples
Example: Extract text between "Dear" and "Sincerely" in a letter.
using LMKit.Document.Search;
var betweenOpts = new BetweenOptions
{
AnchorTextOptions = new TextSearchOptions
{
Comparison = StringComparison.OrdinalIgnoreCase
},
Inclusive = false, // Exclude the anchor strings themselves
MaxChars = 5000 // Safety cap on extracted length
};
var engine = new LayoutSearchEngine();
IReadOnlyList<TextRegion> spans = engine.FindBetween(page, "Dear", "Sincerely", betweenOpts);
foreach (TextRegion span in spans)
{
Console.WriteLine($"Letter body: {span.Snippet}");
}
Properties
- AnchorTextOptions
Controls how the anchor strings are matched.
- Inclusive
If true, the returned text includes the anchors themselves; otherwise, only the text in between is returned.
- MaxChars
A safety cap on the number of characters extracted.