Interface OffsetAwareNormalizer

All Superinterfaces:
CharSequenceNormalizer, Serializable

public interface OffsetAwareNormalizer extends CharSequenceNormalizer
A CharSequenceNormalizer that can additionally report the Alignment from its normalized output back to the input, so a span found in the normalized text maps to the exact character offsets of the original.

Length-changing folds move offsets: collapsing a run of whitespace, folding a supplementary dash to one ASCII hyphen, or stripping invisible controls all shift every later character. A rung that performs such a fold over the cursor-based CharClass engine can record those edits and expose them through normalizeAligned(CharSequence). A rung that delegates to Normalizer (NFC/NFKC) or to a stemmer cannot report its edits, so it does not implement this interface; that is a deliberate capability split rather than an oversight.

TextNormalizer.Builder.buildAligned() composes a chain of these into a single offset-aware pipeline whose AlignedText maps a match all the way back to the original input. An interface-typed caller tests for the capability (normalizer instanceof OffsetAwareNormalizer) instead of depending on a concrete rung, the same plain instanceof pattern used by OffsetMappingNameFinder (in the DL layer) rather than reflection.