Method DetectAsync
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
DetectAsync(Attachment, string, OcrEngine, PiiPatternKinds, CancellationToken)
Asynchronously detects identifiers in a document and reports them as entities with their occurrences: page index and bounding box on the page.
public static Task<List<PiiExtraction.PiiExtractedEntity>> DetectAsync(Attachment content, string pageRange = null, OcrEngine ocrEngine = null, PiiPatternKinds kinds = PiiPatternKinds.All, CancellationToken cancellationToken = default)
Parameters
contentAttachmentThe document or image to scan.
pageRangestringA page range using 1-based page numbers (e.g.
"1-5, 7").null, empty or"*"scans every page.ocrEngineOcrEngineAn optional OCR engine reading the pages that carry no text layer (scans); without it such pages yield nothing.
kindsPiiPatternKindsThe detectors to run. Default: all of them.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<List<PiiExtraction.PiiExtractedEntity>>
One entity per distinct identifier, each with a confidence of 1.
Exceptions
- ArgumentNullException
contentisnull.