Table of Contents

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

text string

The text to scan.

kinds PiiPatternKinds

The detectors to run. Default: all of them.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

List<PiiExtraction.PiiExtractedEntity>

One entity per distinct identifier, each with a confidence of 1.

Exceptions

ArgumentNullException

text is null.

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

content Attachment

The document or image to scan.

pageRange string

A page range using 1-based page numbers (e.g. "1-5, 7"). null, empty or "*" scans every page.

ocrEngine OcrEngine

An optional OCR engine reading the pages that carry no text layer (scans); without it such pages yield nothing.

kinds PiiPatternKinds

The detectors to run. Default: all of them.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

List<PiiExtraction.PiiExtractedEntity>

One entity per distinct identifier, each with a confidence of 1.

Exceptions

ArgumentNullException

content is null.

Share