mongol-norm (Rust)
English
Shape-aware normalizer for Traditional Mongolian (Hudum) script — the pure-Rust twin of the
mongol-norm Python package, living in the same
repository. It implements the UTN #57 v4 shaping pipeline and the FVS-pinned canonical
normalizer with zero dependencies, and produces byte-identical results to the Python package on
every value-producing operation (shaping, normalization, the written-unit APIs, the CLI results;
only some error-message spellings and shape_detailed's alias of structural tokens differ)
of the same version (verified against the shared corpus and golden fixtures in CI).
The crate is developed in this repository and is not on crates.io yet. Until it is published, depend on it from git:
[]
= { = "https://github.com/Satsrag/mongol-norm", = "0.0.4" }
# once published to crates.io
[]
= "0.0.4"
use ;
The mongol-norm binary offers the same subcommands as the Python CLI (shape, normalize,
normalize-text, normalize-written-units, same). Until the crate is published, install it
from a checkout of this repository:
- Only
MNG(Hudum) has shaping rules and a normalize table;TOD/SIB/MCHshape default and FVS forms only, exactly like the Python package. - The data tables in
src/generated/are generated frommongol_norm/data/*.jsonbyscripts/gen_rust_tables.py— never edit them by hand. - The corpus and golden tests read the repository's shared
tests/directory, socargo testneeds a repository checkout (the published crate does not include them). - Design and fidelity contract:
docs/superpowers/specs/2026-09-01-rust-core-design.md.
中文
传统蒙古文(回鹘式)形态感知规范化器的 纯 Rust 实现,与同仓库的 Python 包
mongol-norm 是一对双实现:实现完整的 UTN #57 v4
整形流程和 FVS 钉死的 canonical 规范化,零依赖,所有产出值的操作与同版本 Python 包逐字节相同(个别错误信息拼写除外;CI 用共享的
语料和 golden 固件验证)。
本 crate 在本仓库中开发,尚未发布到 crates.io。发布之前请用 git 依赖:
[]
= { = "https://github.com/Satsrag/mongol-norm", = "0.0.4" }
# 发布到 crates.io 之后
[]
= "0.0.4"
- 只有
MNG(回鹘式蒙古文)有整形规则和规范化表;TOD/SIB/MCH与 Python 一样只整形默认形和 FVS 形。 src/generated/下的数据表由scripts/gen_rust_tables.py从mongol_norm/data/*.json生成,请勿手改。- 语料与 golden 测试读取仓库共享的
tests/目录,因此cargo test需要仓库 checkout(发布的 crate 不包含它们)。 - 命令行工具
mongol-norm与 Python 版子命令相同;发布之前请从仓库 checkout 安装: