Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedactWithPlaceholders ¶
func RedactWithPlaceholders(text string, entities []*entity.CanonicalEntity, opts *RedactOptions) string
RedactWithPlaceholders replaces spans in text with placeholders. When UseEnriched is false, uses legacy format [TYPE]. When true, uses <PII type="TYPE" id="N" .../> with deterministic attribute order (type, id, then allowed attributes in sorted order). Entities must be sorted by start offset and non-overlapping (caller responsibility).
Types ¶
type AllowedAttrs ¶
AllowedAttrs returns which attributes may be emitted for an entity (by id). If nil or id not present, no extra attributes are emitted.
type RedactOptions ¶
type RedactOptions struct {
UseEnriched bool // if true, render XML-style with attributes when allowed
Allowed AllowedAttrs // which attributes to emit per entity (used when UseEnriched)
}
RedactOptions configures placeholder rendering.
Click to show internal directories.
Click to hide internal directories.