Dependency-light NLP artifacts for analyzer scoring.
Presidio runs NLP once and passes token, lemma, keyword, and offset artifacts through the analyzer. Obscura keeps the default implementation deterministic and dependency-free while exposing the same kind of data to context scoring and future recognizers.
Summary
Functions
Builds deterministic token artifacts from raw text.
Normalizes a token for whole-word context matching.
Attaches precomputed model outputs to artifacts.
Returns normalized surrounding token text around a byte span.
Returns token indexes around a byte span.
Types
@type token_offset() :: %{byte_start: non_neg_integer(), byte_end: non_neg_integer()}
Functions
Builds deterministic token artifacts from raw text.
Normalizes a token for whole-word context matching.
Attaches precomputed model outputs to artifacts.
This mirrors Presidio's pattern where a model/NLP engine can run once and downstream recognizers consume the resulting artifacts instead of invoking model serving independently.
@spec surrounding_terms(t(), non_neg_integer(), non_neg_integer(), keyword()) :: [ String.t() ]
Returns normalized surrounding token text around a byte span.
@spec surrounding_token_indexes(t(), non_neg_integer(), non_neg_integer(), keyword()) :: [ non_neg_integer() ]
Returns token indexes around a byte span.