Normalization¶
Canonical forms for indicator values.
Normalization never replaces the original sieve value. Callers keep both. The steps are Unicode NFKC, refanging, trimming, and a type-specific rewrite.
Functions:
-
normalize_value–Return the canonical form of one indicator value.
-
fold_domain–Lower-case a domain, drop a trailing dot, and encode it with IDNA.
-
apply_input_nfkc–Apply NFKC per character and record original spans.
normalize_value
¶
fold_domain
¶
apply_input_nfkc
¶
Apply NFKC per character and record original spans.
Compatibility characters such as full-width dots become their ASCII equivalents. Each output character maps back to the source character that produced it, so later offset tracking still points at the input.
Parameters:
-
text(str) –Original input.
Returns: