Method Detect
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
Detect(string, PiiPatternKinds, CancellationToken)
Detects identifiers in text and reports them as
entities with their occurrences.
public static List<PiiExtraction.PiiExtractedEntity> Detect(string text, PiiPatternKinds kinds = PiiPatternKinds.All, CancellationToken cancellationToken = default)
Parameters
textstringThe text to scan.
kindsPiiPatternKindsThe detectors to run. Default: all of them.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- List<PiiExtraction.PiiExtractedEntity>
One entity per distinct identifier, each with a confidence of 1.
Exceptions
- ArgumentNullException
textisnull.
Detect(Attachment, string, OcrEngine, PiiPatternKinds, CancellationToken)
Detects identifiers in a document and reports them as entities with their occurrences: page index and bounding box on the page.
public static List<PiiExtraction.PiiExtractedEntity> Detect(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
- List<PiiExtraction.PiiExtractedEntity>
One entity per distinct identifier, each with a confidence of 1.
Exceptions
- ArgumentNullException
contentisnull.