Fix joiner-aware text normalization and version MNG canonical output - #12
Closed
satsragclaw wants to merge 3 commits into
Closed
Fix joiner-aware text normalization and version MNG canonical output#12satsragclaw wants to merge 3 commits into
satsragclaw wants to merge 3 commits into
Conversation
satsragclaw
force-pushed
the
refactor/phase-0-contracts
branch
from
July 14, 2026 14:38
c3df3f6 to
f0c2cff
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
normalize_text(), preserving Nirugu/ZWJ joining contextmng-canonical/1, expose it throughMongolianShaper.canonical_version, embed it in the normalize table, and reject mismatched table versionsscripts/gen_compat_goldens.pywith write and--checkmodes; serialization is key-sorted for Python 3.6 portabilityWhy
normalize_text()previously split runs at Nirugu and ZWJ even thoughnormalize()accepted both as word characters. Splitting at a joiner changes neighboring positions and could produce a different canonical form.The goldens lock the current shaping transitions and canonical Unicode outputs so later refactors cannot change them silently. They were replayed against unmodified
upstream/main@8d43521962ef489443e18f900491ba9f5ea72e05with zero differences.Verification
python3 -m compileall -q mongol_norm scripts testspython3 scripts/gen_compat_goldens.py --checkpython3 -m unittest discover -s tests -p 'test_*.py'uv buildsucceeded for wheel and sdistCloses #10