text-processing-rs 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- text_processing_rs-0.3.4/.github/workflows/ci.yml +101 -0
- text_processing_rs-0.3.4/.github/workflows/crates-publish.yml +41 -0
- text_processing_rs-0.3.4/.github/workflows/npm-publish.yml +41 -0
- text_processing_rs-0.3.4/.github/workflows/parity.yml +38 -0
- text_processing_rs-0.3.4/.github/workflows/python-release.yml +109 -0
- text_processing_rs-0.3.4/.github/workflows/xcframework.yml +62 -0
- text_processing_rs-0.3.4/.gitignore +5 -0
- text_processing_rs-0.3.4/AGENTS.md +78 -0
- text_processing_rs-0.3.4/CLAUDE.md +23 -0
- text_processing_rs-0.3.4/Cargo.lock +693 -0
- text_processing_rs-0.3.4/Cargo.toml +49 -0
- text_processing_rs-0.3.4/LICENSE +201 -0
- text_processing_rs-0.3.4/Makefile +79 -0
- text_processing_rs-0.3.4/NOTICE +24 -0
- text_processing_rs-0.3.4/PKG-INFO +472 -0
- text_processing_rs-0.3.4/README.md +461 -0
- text_processing_rs-0.3.4/THIRD-PARTY-LICENSES.md +54 -0
- text_processing_rs-0.3.4/build-xcframework.sh +88 -0
- text_processing_rs-0.3.4/docs/NEMO_PARITY.md +231 -0
- text_processing_rs-0.3.4/examples/parity.rs +269 -0
- text_processing_rs-0.3.4/grammars/de/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/de/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/de/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/de/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/en/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/en/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/en/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/en/postprocess.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/en/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/es/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/es/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/es/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/es/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/fr/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/fr/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/fr/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/fr/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/hi/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/hi/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/hi/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/hi/postprocess.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/hi/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/it/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/it/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/ja/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/ja/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/ja/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/ja/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/zh/classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/zh/itn_classify.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/zh/itn_verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/grammars/zh/verbalize.fst.gz +0 -0
- text_processing_rs-0.3.4/package.json +23 -0
- text_processing_rs-0.3.4/pyproject.toml +14 -0
- text_processing_rs-0.3.4/scripts/check-python-wheel.py +14 -0
- text_processing_rs-0.3.4/scripts/export_nemo_grammars.py +66 -0
- text_processing_rs-0.3.4/scripts/generate_nemo_fixtures.py +71 -0
- text_processing_rs-0.3.4/scripts/predict-python-version.py +89 -0
- text_processing_rs-0.3.4/scripts/set-wasm-package-name.mjs +13 -0
- text_processing_rs-0.3.4/src/custom_rules.rs +222 -0
- text_processing_rs-0.3.4/src/ffi.rs +1062 -0
- text_processing_rs-0.3.4/src/fst/de.rs +47 -0
- text_processing_rs-0.3.4/src/fst/driver.rs +676 -0
- text_processing_rs-0.3.4/src/fst/en.rs +57 -0
- text_processing_rs-0.3.4/src/fst/engine.rs +196 -0
- text_processing_rs-0.3.4/src/fst/es.rs +47 -0
- text_processing_rs-0.3.4/src/fst/fr.rs +47 -0
- text_processing_rs-0.3.4/src/fst/hi.rs +48 -0
- text_processing_rs-0.3.4/src/fst/it.rs +38 -0
- text_processing_rs-0.3.4/src/fst/ja.rs +47 -0
- text_processing_rs-0.3.4/src/fst/mod.rs +198 -0
- text_processing_rs-0.3.4/src/fst/zh.rs +48 -0
- text_processing_rs-0.3.4/src/itn/de/cardinal.rs +447 -0
- text_processing_rs-0.3.4/src/itn/de/date.rs +275 -0
- text_processing_rs-0.3.4/src/itn/de/decimal.rs +188 -0
- text_processing_rs-0.3.4/src/itn/de/electronic.rs +115 -0
- text_processing_rs-0.3.4/src/itn/de/fraction.rs +224 -0
- text_processing_rs-0.3.4/src/itn/de/measure.rs +259 -0
- text_processing_rs-0.3.4/src/itn/de/mod.rs +20 -0
- text_processing_rs-0.3.4/src/itn/de/money.rs +408 -0
- text_processing_rs-0.3.4/src/itn/de/ordinal.rs +134 -0
- text_processing_rs-0.3.4/src/itn/de/punctuation.rs +50 -0
- text_processing_rs-0.3.4/src/itn/de/telephone.rs +85 -0
- text_processing_rs-0.3.4/src/itn/de/time.rs +422 -0
- text_processing_rs-0.3.4/src/itn/de/whitelist.rs +121 -0
- text_processing_rs-0.3.4/src/itn/de/word.rs +14 -0
- text_processing_rs-0.3.4/src/itn/en/cardinal.rs +666 -0
- text_processing_rs-0.3.4/src/itn/en/date.rs +546 -0
- text_processing_rs-0.3.4/src/itn/en/decimal.rs +196 -0
- text_processing_rs-0.3.4/src/itn/en/electronic.rs +398 -0
- text_processing_rs-0.3.4/src/itn/en/fraction.rs +197 -0
- text_processing_rs-0.3.4/src/itn/en/measure.rs +376 -0
- text_processing_rs-0.3.4/src/itn/en/mod.rs +20 -0
- text_processing_rs-0.3.4/src/itn/en/money.rs +406 -0
- text_processing_rs-0.3.4/src/itn/en/ordinal.rs +192 -0
- text_processing_rs-0.3.4/src/itn/en/punctuation.rs +124 -0
- text_processing_rs-0.3.4/src/itn/en/telephone.rs +758 -0
- text_processing_rs-0.3.4/src/itn/en/time.rs +517 -0
- text_processing_rs-0.3.4/src/itn/en/whitelist.rs +137 -0
- text_processing_rs-0.3.4/src/itn/en/word.rs +102 -0
- text_processing_rs-0.3.4/src/itn/es/cardinal.rs +434 -0
- text_processing_rs-0.3.4/src/itn/es/date.rs +206 -0
- text_processing_rs-0.3.4/src/itn/es/decimal.rs +377 -0
- text_processing_rs-0.3.4/src/itn/es/electronic.rs +139 -0
- text_processing_rs-0.3.4/src/itn/es/fraction.rs +214 -0
- text_processing_rs-0.3.4/src/itn/es/measure.rs +293 -0
- text_processing_rs-0.3.4/src/itn/es/mod.rs +20 -0
- text_processing_rs-0.3.4/src/itn/es/money.rs +434 -0
- text_processing_rs-0.3.4/src/itn/es/ordinal.rs +193 -0
- text_processing_rs-0.3.4/src/itn/es/punctuation.rs +34 -0
- text_processing_rs-0.3.4/src/itn/es/telephone.rs +225 -0
- text_processing_rs-0.3.4/src/itn/es/time.rs +339 -0
- text_processing_rs-0.3.4/src/itn/es/whitelist.rs +83 -0
- text_processing_rs-0.3.4/src/itn/es/word.rs +8 -0
- text_processing_rs-0.3.4/src/itn/fr/cardinal.rs +269 -0
- text_processing_rs-0.3.4/src/itn/fr/date.rs +138 -0
- text_processing_rs-0.3.4/src/itn/fr/decimal.rs +285 -0
- text_processing_rs-0.3.4/src/itn/fr/electronic.rs +148 -0
- text_processing_rs-0.3.4/src/itn/fr/fraction.rs +154 -0
- text_processing_rs-0.3.4/src/itn/fr/measure.rs +320 -0
- text_processing_rs-0.3.4/src/itn/fr/mod.rs +20 -0
- text_processing_rs-0.3.4/src/itn/fr/money.rs +320 -0
- text_processing_rs-0.3.4/src/itn/fr/ordinal.rs +308 -0
- text_processing_rs-0.3.4/src/itn/fr/punctuation.rs +85 -0
- text_processing_rs-0.3.4/src/itn/fr/telephone.rs +176 -0
- text_processing_rs-0.3.4/src/itn/fr/time.rs +215 -0
- text_processing_rs-0.3.4/src/itn/fr/whitelist.rs +49 -0
- text_processing_rs-0.3.4/src/itn/fr/word.rs +102 -0
- text_processing_rs-0.3.4/src/itn/hi/address.rs +123 -0
- text_processing_rs-0.3.4/src/itn/hi/cardinal.rs +461 -0
- text_processing_rs-0.3.4/src/itn/hi/date.rs +293 -0
- text_processing_rs-0.3.4/src/itn/hi/decimal.rs +124 -0
- text_processing_rs-0.3.4/src/itn/hi/fraction.rs +362 -0
- text_processing_rs-0.3.4/src/itn/hi/measure.rs +346 -0
- text_processing_rs-0.3.4/src/itn/hi/mod.rs +14 -0
- text_processing_rs-0.3.4/src/itn/hi/money.rs +273 -0
- text_processing_rs-0.3.4/src/itn/hi/ordinal.rs +121 -0
- text_processing_rs-0.3.4/src/itn/hi/telephone.rs +169 -0
- text_processing_rs-0.3.4/src/itn/hi/time.rs +479 -0
- text_processing_rs-0.3.4/src/itn/hi/whitelist.rs +76 -0
- text_processing_rs-0.3.4/src/itn/hi/word.rs +9 -0
- text_processing_rs-0.3.4/src/itn/ja/cardinal.rs +279 -0
- text_processing_rs-0.3.4/src/itn/ja/date.rs +259 -0
- text_processing_rs-0.3.4/src/itn/ja/decimal.rs +128 -0
- text_processing_rs-0.3.4/src/itn/ja/fraction.rs +165 -0
- text_processing_rs-0.3.4/src/itn/ja/mod.rs +12 -0
- text_processing_rs-0.3.4/src/itn/ja/ordinal.rs +113 -0
- text_processing_rs-0.3.4/src/itn/ja/time.rs +144 -0
- text_processing_rs-0.3.4/src/itn/mod.rs +24 -0
- text_processing_rs-0.3.4/src/itn/zh/cardinal.rs +612 -0
- text_processing_rs-0.3.4/src/itn/zh/date.rs +138 -0
- text_processing_rs-0.3.4/src/itn/zh/decimal.rs +143 -0
- text_processing_rs-0.3.4/src/itn/zh/fraction.rs +121 -0
- text_processing_rs-0.3.4/src/itn/zh/mod.rs +15 -0
- text_processing_rs-0.3.4/src/itn/zh/money.rs +212 -0
- text_processing_rs-0.3.4/src/itn/zh/ordinal.rs +69 -0
- text_processing_rs-0.3.4/src/itn/zh/time.rs +244 -0
- text_processing_rs-0.3.4/src/itn/zh/whitelist.rs +54 -0
- text_processing_rs-0.3.4/src/itn/zh/word.rs +10 -0
- text_processing_rs-0.3.4/src/lib.rs +2043 -0
- text_processing_rs-0.3.4/src/options.rs +88 -0
- text_processing_rs-0.3.4/src/python.rs +32 -0
- text_processing_rs-0.3.4/src/tn/de/cardinal.rs +88 -0
- text_processing_rs-0.3.4/src/tn/de/date.rs +353 -0
- text_processing_rs-0.3.4/src/tn/de/decimal.rs +134 -0
- text_processing_rs-0.3.4/src/tn/de/electronic.rs +169 -0
- text_processing_rs-0.3.4/src/tn/de/measure.rs +235 -0
- text_processing_rs-0.3.4/src/tn/de/mod.rs +288 -0
- text_processing_rs-0.3.4/src/tn/de/money.rs +312 -0
- text_processing_rs-0.3.4/src/tn/de/ordinal.rs +126 -0
- text_processing_rs-0.3.4/src/tn/de/telephone.rs +178 -0
- text_processing_rs-0.3.4/src/tn/de/time.rs +157 -0
- text_processing_rs-0.3.4/src/tn/de/whitelist.rs +90 -0
- text_processing_rs-0.3.4/src/tn/en/address.rs +214 -0
- text_processing_rs-0.3.4/src/tn/en/cardinal.rs +134 -0
- text_processing_rs-0.3.4/src/tn/en/date.rs +640 -0
- text_processing_rs-0.3.4/src/tn/en/decimal.rs +183 -0
- text_processing_rs-0.3.4/src/tn/en/electronic.rs +485 -0
- text_processing_rs-0.3.4/src/tn/en/fraction.rs +167 -0
- text_processing_rs-0.3.4/src/tn/en/math.rs +86 -0
- text_processing_rs-0.3.4/src/tn/en/measure.rs +405 -0
- text_processing_rs-0.3.4/src/tn/en/mod.rs +301 -0
- text_processing_rs-0.3.4/src/tn/en/money.rs +392 -0
- text_processing_rs-0.3.4/src/tn/en/ordinal.rs +178 -0
- text_processing_rs-0.3.4/src/tn/en/range.rs +174 -0
- text_processing_rs-0.3.4/src/tn/en/roman.rs +441 -0
- text_processing_rs-0.3.4/src/tn/en/serial.rs +227 -0
- text_processing_rs-0.3.4/src/tn/en/telephone.rs +230 -0
- text_processing_rs-0.3.4/src/tn/en/time.rs +246 -0
- text_processing_rs-0.3.4/src/tn/en/whitelist.rs +161 -0
- text_processing_rs-0.3.4/src/tn/en/word.rs +129 -0
- text_processing_rs-0.3.4/src/tn/es/cardinal.rs +86 -0
- text_processing_rs-0.3.4/src/tn/es/date.rs +349 -0
- text_processing_rs-0.3.4/src/tn/es/decimal.rs +136 -0
- text_processing_rs-0.3.4/src/tn/es/electronic.rs +172 -0
- text_processing_rs-0.3.4/src/tn/es/measure.rs +247 -0
- text_processing_rs-0.3.4/src/tn/es/mod.rs +288 -0
- text_processing_rs-0.3.4/src/tn/es/money.rs +333 -0
- text_processing_rs-0.3.4/src/tn/es/ordinal.rs +192 -0
- text_processing_rs-0.3.4/src/tn/es/telephone.rs +175 -0
- text_processing_rs-0.3.4/src/tn/es/time.rs +104 -0
- text_processing_rs-0.3.4/src/tn/es/whitelist.rs +118 -0
- text_processing_rs-0.3.4/src/tn/fr/cardinal.rs +86 -0
- text_processing_rs-0.3.4/src/tn/fr/date.rs +353 -0
- text_processing_rs-0.3.4/src/tn/fr/decimal.rs +138 -0
- text_processing_rs-0.3.4/src/tn/fr/electronic.rs +176 -0
- text_processing_rs-0.3.4/src/tn/fr/measure.rs +228 -0
- text_processing_rs-0.3.4/src/tn/fr/mod.rs +226 -0
- text_processing_rs-0.3.4/src/tn/fr/money.rs +312 -0
- text_processing_rs-0.3.4/src/tn/fr/ordinal.rs +130 -0
- text_processing_rs-0.3.4/src/tn/fr/telephone.rs +175 -0
- text_processing_rs-0.3.4/src/tn/fr/time.rs +145 -0
- text_processing_rs-0.3.4/src/tn/fr/whitelist.rs +84 -0
- text_processing_rs-0.3.4/src/tn/hi/cardinal.rs +93 -0
- text_processing_rs-0.3.4/src/tn/hi/date.rs +317 -0
- text_processing_rs-0.3.4/src/tn/hi/decimal.rs +133 -0
- text_processing_rs-0.3.4/src/tn/hi/electronic.rs +167 -0
- text_processing_rs-0.3.4/src/tn/hi/measure.rs +236 -0
- text_processing_rs-0.3.4/src/tn/hi/mod.rs +298 -0
- text_processing_rs-0.3.4/src/tn/hi/money.rs +311 -0
- text_processing_rs-0.3.4/src/tn/hi/ordinal.rs +99 -0
- text_processing_rs-0.3.4/src/tn/hi/telephone.rs +175 -0
- text_processing_rs-0.3.4/src/tn/hi/time.rs +159 -0
- text_processing_rs-0.3.4/src/tn/hi/whitelist.rs +90 -0
- text_processing_rs-0.3.4/src/tn/ja/cardinal.rs +94 -0
- text_processing_rs-0.3.4/src/tn/ja/date.rs +355 -0
- text_processing_rs-0.3.4/src/tn/ja/decimal.rs +126 -0
- text_processing_rs-0.3.4/src/tn/ja/electronic.rs +162 -0
- text_processing_rs-0.3.4/src/tn/ja/measure.rs +220 -0
- text_processing_rs-0.3.4/src/tn/ja/mod.rs +233 -0
- text_processing_rs-0.3.4/src/tn/ja/money.rs +291 -0
- text_processing_rs-0.3.4/src/tn/ja/ordinal.rs +99 -0
- text_processing_rs-0.3.4/src/tn/ja/telephone.rs +175 -0
- text_processing_rs-0.3.4/src/tn/ja/time.rs +239 -0
- text_processing_rs-0.3.4/src/tn/ja/whitelist.rs +87 -0
- text_processing_rs-0.3.4/src/tn/mod.rs +91 -0
- text_processing_rs-0.3.4/src/tn/zh/cardinal.rs +96 -0
- text_processing_rs-0.3.4/src/tn/zh/date.rs +345 -0
- text_processing_rs-0.3.4/src/tn/zh/decimal.rs +118 -0
- text_processing_rs-0.3.4/src/tn/zh/electronic.rs +158 -0
- text_processing_rs-0.3.4/src/tn/zh/measure.rs +275 -0
- text_processing_rs-0.3.4/src/tn/zh/mod.rs +198 -0
- text_processing_rs-0.3.4/src/tn/zh/money.rs +303 -0
- text_processing_rs-0.3.4/src/tn/zh/ordinal.rs +87 -0
- text_processing_rs-0.3.4/src/tn/zh/telephone.rs +175 -0
- text_processing_rs-0.3.4/src/tn/zh/time.rs +156 -0
- text_processing_rs-0.3.4/src/tn/zh/whitelist.rs +87 -0
- text_processing_rs-0.3.4/src/wasm.rs +241 -0
- text_processing_rs-0.3.4/swift/NemoTextProcessing.swift +470 -0
- text_processing_rs-0.3.4/swift/include/CNemoTextProcessing/module.modulemap +4 -0
- text_processing_rs-0.3.4/swift/include/CNemoTextProcessing/nemo_text_processing.h +295 -0
- text_processing_rs-0.3.4/swift-test/.gitignore +8 -0
- text_processing_rs-0.3.4/swift-test/Package.swift +48 -0
- text_processing_rs-0.3.4/swift-test/Sources/CNemoTextProcessing/include/nemo_text_processing.h +99 -0
- text_processing_rs-0.3.4/swift-test/Sources/CNemoTextProcessing/module.modulemap +5 -0
- text_processing_rs-0.3.4/swift-test/Sources/NemoTest/NLTaggerEdgeCases.swift +136 -0
- text_processing_rs-0.3.4/swift-test/Sources/NemoTest/NemoTest.swift +533 -0
- text_processing_rs-0.3.4/swift-test/Sources/nemo-itn/main.swift +84 -0
- text_processing_rs-0.3.4/swift-test/Sources/nemo-tn/main.swift +79 -0
- text_processing_rs-0.3.4/swift-test/Sources/nemo-tn-aligned/main.swift +180 -0
- text_processing_rs-0.3.4/tests/common/mod.rs +105 -0
- text_processing_rs-0.3.4/tests/data/de/cardinal.txt +62 -0
- text_processing_rs-0.3.4/tests/data/de/date.txt +22 -0
- text_processing_rs-0.3.4/tests/data/de/decimal.txt +10 -0
- text_processing_rs-0.3.4/tests/data/de/electronic.txt +9 -0
- text_processing_rs-0.3.4/tests/data/de/fraction.txt +34 -0
- text_processing_rs-0.3.4/tests/data/de/measure.txt +28 -0
- text_processing_rs-0.3.4/tests/data/de/money.txt +23 -0
- text_processing_rs-0.3.4/tests/data/de/ordinal.txt +20 -0
- text_processing_rs-0.3.4/tests/data/de/telephone.txt +1 -0
- text_processing_rs-0.3.4/tests/data/de/time.txt +24 -0
- text_processing_rs-0.3.4/tests/data/de/whitelist.txt +6 -0
- text_processing_rs-0.3.4/tests/data/de/word.txt +49 -0
- text_processing_rs-0.3.4/tests/data/en/cardinal.txt +29 -0
- text_processing_rs-0.3.4/tests/data/en/cardinal_cased.txt +60 -0
- text_processing_rs-0.3.4/tests/data/en/date.txt +36 -0
- text_processing_rs-0.3.4/tests/data/en/date_cased.txt +70 -0
- text_processing_rs-0.3.4/tests/data/en/decimal.txt +63 -0
- text_processing_rs-0.3.4/tests/data/en/decimal_cased.txt +129 -0
- text_processing_rs-0.3.4/tests/data/en/electronic.txt +25 -0
- text_processing_rs-0.3.4/tests/data/en/electronic_cased.txt +59 -0
- text_processing_rs-0.3.4/tests/data/en/measure.txt +112 -0
- text_processing_rs-0.3.4/tests/data/en/measure_cased.txt +232 -0
- text_processing_rs-0.3.4/tests/data/en/money.txt +52 -0
- text_processing_rs-0.3.4/tests/data/en/money_cased.txt +54 -0
- text_processing_rs-0.3.4/tests/data/en/ordinal.txt +34 -0
- text_processing_rs-0.3.4/tests/data/en/ordinal_cased.txt +34 -0
- text_processing_rs-0.3.4/tests/data/en/telephone.txt +23 -0
- text_processing_rs-0.3.4/tests/data/en/telephone_cased.txt +18 -0
- text_processing_rs-0.3.4/tests/data/en/time.txt +29 -0
- text_processing_rs-0.3.4/tests/data/en/time_cased.txt +33 -0
- text_processing_rs-0.3.4/tests/data/en/tn_cardinal.txt +20 -0
- text_processing_rs-0.3.4/tests/data/en/tn_date.txt +53 -0
- text_processing_rs-0.3.4/tests/data/en/tn_decimal.txt +12 -0
- text_processing_rs-0.3.4/tests/data/en/tn_electronic.txt +49 -0
- text_processing_rs-0.3.4/tests/data/en/tn_fraction.txt +16 -0
- text_processing_rs-0.3.4/tests/data/en/tn_math.txt +4 -0
- text_processing_rs-0.3.4/tests/data/en/tn_measure.txt +18 -0
- text_processing_rs-0.3.4/tests/data/en/tn_money.txt +71 -0
- text_processing_rs-0.3.4/tests/data/en/tn_ordinal.txt +30 -0
- text_processing_rs-0.3.4/tests/data/en/tn_range.txt +18 -0
- text_processing_rs-0.3.4/tests/data/en/tn_roman.txt +8 -0
- text_processing_rs-0.3.4/tests/data/en/tn_telephone.txt +10 -0
- text_processing_rs-0.3.4/tests/data/en/tn_time.txt +21 -0
- text_processing_rs-0.3.4/tests/data/en/tn_whitelist.txt +11 -0
- text_processing_rs-0.3.4/tests/data/en/whitelist.txt +12 -0
- text_processing_rs-0.3.4/tests/data/en/whitelist_cased.txt +9 -0
- text_processing_rs-0.3.4/tests/data/en/word.txt +55 -0
- text_processing_rs-0.3.4/tests/data/en/word_cased.txt +49 -0
- text_processing_rs-0.3.4/tests/data/es/cardinal.txt +51 -0
- text_processing_rs-0.3.4/tests/data/es/cardinal_cased.txt +30 -0
- text_processing_rs-0.3.4/tests/data/es/date.txt +8 -0
- text_processing_rs-0.3.4/tests/data/es/date_cased.txt +8 -0
- text_processing_rs-0.3.4/tests/data/es/decimal.txt +29 -0
- text_processing_rs-0.3.4/tests/data/es/decimal_cased.txt +6 -0
- text_processing_rs-0.3.4/tests/data/es/electronic.txt +16 -0
- text_processing_rs-0.3.4/tests/data/es/electronic_cased.txt +5 -0
- text_processing_rs-0.3.4/tests/data/es/fraction.txt +12 -0
- text_processing_rs-0.3.4/tests/data/es/measure.txt +20 -0
- text_processing_rs-0.3.4/tests/data/es/measure_cased.txt +11 -0
- text_processing_rs-0.3.4/tests/data/es/money.txt +24 -0
- text_processing_rs-0.3.4/tests/data/es/money_cased.txt +6 -0
- text_processing_rs-0.3.4/tests/data/es/ordinal.txt +30 -0
- text_processing_rs-0.3.4/tests/data/es/ordinal_cased.txt +11 -0
- text_processing_rs-0.3.4/tests/data/es/telephone.txt +9 -0
- text_processing_rs-0.3.4/tests/data/es/telephone_cased.txt +6 -0
- text_processing_rs-0.3.4/tests/data/es/time.txt +25 -0
- text_processing_rs-0.3.4/tests/data/es/time_cased.txt +9 -0
- text_processing_rs-0.3.4/tests/data/es/whitelist.txt +5 -0
- text_processing_rs-0.3.4/tests/data/es/word.txt +49 -0
- text_processing_rs-0.3.4/tests/data/es/word_cased.txt +11 -0
- text_processing_rs-0.3.4/tests/data/fr/cardinal.txt +106 -0
- text_processing_rs-0.3.4/tests/data/fr/date.txt +6 -0
- text_processing_rs-0.3.4/tests/data/fr/decimal.txt +15 -0
- text_processing_rs-0.3.4/tests/data/fr/electronic.txt +10 -0
- text_processing_rs-0.3.4/tests/data/fr/fraction.txt +30 -0
- text_processing_rs-0.3.4/tests/data/fr/measure.txt +15 -0
- text_processing_rs-0.3.4/tests/data/fr/money.txt +22 -0
- text_processing_rs-0.3.4/tests/data/fr/ordinal.txt +23 -0
- text_processing_rs-0.3.4/tests/data/fr/telephone.txt +5 -0
- text_processing_rs-0.3.4/tests/data/fr/time.txt +18 -0
- text_processing_rs-0.3.4/tests/data/fr/whitelist.txt +8 -0
- text_processing_rs-0.3.4/tests/data/fr/word.txt +49 -0
- text_processing_rs-0.3.4/tests/data/hi/address.txt +25 -0
- text_processing_rs-0.3.4/tests/data/hi/cardinal.txt +54 -0
- text_processing_rs-0.3.4/tests/data/hi/date.txt +42 -0
- text_processing_rs-0.3.4/tests/data/hi/decimal.txt +13 -0
- text_processing_rs-0.3.4/tests/data/hi/fraction.txt +31 -0
- text_processing_rs-0.3.4/tests/data/hi/measure.txt +48 -0
- text_processing_rs-0.3.4/tests/data/hi/money.txt +50 -0
- text_processing_rs-0.3.4/tests/data/hi/ordinal.txt +13 -0
- text_processing_rs-0.3.4/tests/data/hi/telephone.txt +28 -0
- text_processing_rs-0.3.4/tests/data/hi/time.txt +25 -0
- text_processing_rs-0.3.4/tests/data/hi/whitelist.txt +8 -0
- text_processing_rs-0.3.4/tests/data/hi/word.txt +15 -0
- text_processing_rs-0.3.4/tests/data/ja/cardinal.txt +28 -0
- text_processing_rs-0.3.4/tests/data/ja/date.txt +31 -0
- text_processing_rs-0.3.4/tests/data/ja/decimal.txt +32 -0
- text_processing_rs-0.3.4/tests/data/ja/fraction.txt +34 -0
- text_processing_rs-0.3.4/tests/data/ja/ordinal.txt +65 -0
- text_processing_rs-0.3.4/tests/data/ja/time.txt +40 -0
- text_processing_rs-0.3.4/tests/data/zh/cardinal.txt +130 -0
- text_processing_rs-0.3.4/tests/data/zh/date.txt +31 -0
- text_processing_rs-0.3.4/tests/data/zh/decimal.txt +42 -0
- text_processing_rs-0.3.4/tests/data/zh/fraction.txt +20 -0
- text_processing_rs-0.3.4/tests/data/zh/money.txt +49 -0
- text_processing_rs-0.3.4/tests/data/zh/ordinal.txt +57 -0
- text_processing_rs-0.3.4/tests/data/zh/time.txt +23 -0
- text_processing_rs-0.3.4/tests/data/zh/whitelist.txt +21 -0
- text_processing_rs-0.3.4/tests/data/zh/word.txt +21 -0
- text_processing_rs-0.3.4/tests/de_tests.rs +166 -0
- text_processing_rs-0.3.4/tests/default_engine.rs +168 -0
- text_processing_rs-0.3.4/tests/en_tests.rs +1518 -0
- text_processing_rs-0.3.4/tests/en_tn_tests.rs +472 -0
- text_processing_rs-0.3.4/tests/es_tests.rs +166 -0
- text_processing_rs-0.3.4/tests/extensive_tests.rs +1541 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_cardinal.txt +53 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_date.txt +18 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_decimal.txt +13 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_electronic.txt +22 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_fraction.txt +37 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_measure.txt +32 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_money.txt +24 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_normalize_with_audio.txt +34 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_ordinal.txt +22 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_telephone.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_time.txt +31 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_whitelist.txt +9 -0
- text_processing_rs-0.3.4/tests/fixtures/de/test_cases_word.txt +51 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_address.txt +14 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_cardinal.txt +21 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_date.txt +57 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_decimal.txt +15 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_electronic.txt +48 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_fraction.txt +19 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_math.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_measure.txt +24 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_money.txt +74 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_ordinal.txt +30 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_punctuation.txt +66 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_punctuation_match_input.txt +16 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_range.txt +23 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_roman.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_serial.txt +35 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_special_text.txt +13 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_telephone.txt +23 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_time.txt +24 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_whitelist.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/en/test_cases_word.txt +40 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_cardinal.txt +72 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_date.txt +24 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_decimal.txt +27 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_electronic.txt +25 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_fraction.txt +78 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_measure.txt +35 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_money.txt +72 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_ordinal.txt +123 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_telephone.txt +18 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_time.txt +38 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_whitelist.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/es/test_cases_word.txt +50 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_cardinal.txt +14 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_date.txt +13 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_decimal.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_fraction.txt +12 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_ordinal.txt +15 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_whitelist.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/fr/test_cases_word.txt +49 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_address.txt +58 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_cardinal.txt +153 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_date.txt +37 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_decimal.txt +23 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_electronic.txt +63 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_fraction.txt +26 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_measure.txt +76 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_money.txt +121 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_ordinal.txt +75 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_telephone.txt +28 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_time.txt +21 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_whitelist.txt +17 -0
- text_processing_rs-0.3.4/tests/fixtures/hi/test_cases_word.txt +18 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_cardinal.txt +16 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_decimal.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_electronic.txt +16 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_measure.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_money.txt +8 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_time.txt +9 -0
- text_processing_rs-0.3.4/tests/fixtures/it/test_cases_whitelist.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_cardinal.txt +64 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_date.txt +24 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_decimal.txt +12 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_electronic.txt +11 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_fraction.txt +36 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_measure.txt +30 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_money.txt +25 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_ordinal.txt +22 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_telephone.txt +3 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_time.txt +26 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_whitelist.txt +8 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/de/test_cases_word.txt +51 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_cardinal.txt +31 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_cardinal_cased.txt +62 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_date.txt +38 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_date_cased.txt +72 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_decimal.txt +65 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_decimal_cased.txt +131 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_electronic.txt +27 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_electronic_cased.txt +61 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_measure.txt +114 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_measure_cased.txt +234 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_money.txt +54 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_money_cased.txt +56 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_ordinal.txt +36 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_ordinal_cased.txt +36 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_telephone.txt +25 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_telephone_cased.txt +20 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_time.txt +31 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_time_cased.txt +35 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_whitelist.txt +14 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_whitelist_cased.txt +11 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_word.txt +57 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/en/test_cases_word_cased.txt +51 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_cardinal.txt +53 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_cardinal_cased.txt +32 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_date.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_date_cased.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_decimal.txt +31 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_decimal_cased.txt +8 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_electronic.txt +18 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_electronic_cased.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_fraction.txt +14 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_measure.txt +22 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_measure_cased.txt +13 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_money.txt +26 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_money_cased.txt +8 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_ordinal.txt +32 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_ordinal_cased.txt +13 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_telephone.txt +11 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_telephone_cased.txt +8 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_time.txt +27 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_time_cased.txt +11 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_whitelist.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_word.txt +51 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/es/test_cases_word_cased.txt +13 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_cardinal.txt +108 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_date.txt +8 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_decimal.txt +17 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_electronic.txt +12 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_fraction.txt +32 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_measure.txt +17 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_money.txt +24 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_ordinal.txt +25 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_telephone.txt +7 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_time.txt +20 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_whitelist.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/fr/test_cases_word.txt +51 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_address.txt +27 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_cardinal.txt +56 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_date.txt +44 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_decimal.txt +15 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_fraction.txt +33 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_measure.txt +50 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_money.txt +52 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_ordinal.txt +15 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_telephone.txt +30 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_time.txt +27 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_whitelist.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/hi/test_cases_word.txt +17 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/ja/test_cases_cardinal.txt +30 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/ja/test_cases_date.txt +33 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/ja/test_cases_decimal.txt +34 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/ja/test_cases_fraction.txt +36 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/ja/test_cases_ordinal.txt +67 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/ja/test_cases_time.txt +42 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_cardinal.txt +132 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_date.txt +33 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_decimal.txt +44 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_fraction.txt +22 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_money.txt +51 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_ordinal.txt +59 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_time.txt +25 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_whitelist.txt +23 -0
- text_processing_rs-0.3.4/tests/fixtures/itn/zh/test_cases_word.txt +23 -0
- text_processing_rs-0.3.4/tests/fixtures/ja/test_cases_cardinal.txt +46 -0
- text_processing_rs-0.3.4/tests/fixtures/ja/test_cases_date.txt +203 -0
- text_processing_rs-0.3.4/tests/fixtures/ja/test_cases_decimal.txt +18 -0
- text_processing_rs-0.3.4/tests/fixtures/ja/test_cases_fraction.txt +21 -0
- text_processing_rs-0.3.4/tests/fixtures/ja/test_cases_ordinal.txt +67 -0
- text_processing_rs-0.3.4/tests/fixtures/ja/test_cases_time.txt +205 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_cardinal.txt +85 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_date.txt +35 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_decimal.txt +35 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_fraction.txt +26 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_measure.txt +11 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_money.txt +22 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_ordinal.txt +84 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_time.txt +34 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_whitelist.txt +10 -0
- text_processing_rs-0.3.4/tests/fixtures/zh/test_cases_word.txt +25 -0
- text_processing_rs-0.3.4/tests/fr_tests.rs +171 -0
- text_processing_rs-0.3.4/tests/fst_alignment.rs +300 -0
- text_processing_rs-0.3.4/tests/fst_itn_parity.rs +74 -0
- text_processing_rs-0.3.4/tests/fst_parity.rs +78 -0
- text_processing_rs-0.3.4/tests/hi_tests.rs +166 -0
- text_processing_rs-0.3.4/tests/ja_tests.rs +94 -0
- text_processing_rs-0.3.4/tests/multilang_itn_tests.rs +167 -0
- text_processing_rs-0.3.4/tests/multilang_tn_tests.rs +384 -0
- text_processing_rs-0.3.4/tests/parity_baseline.tsv +180 -0
- text_processing_rs-0.3.4/tests/zh_tests.rs +130 -0
- text_processing_rs-0.3.4/wasm-tests/node-fst-smoke.mjs +48 -0
- text_processing_rs-0.3.4/wasm-tests/node-smoke.mjs +47 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
RUST_BACKTRACE: 1
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
fmt:
|
|
15
|
+
name: Format
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
20
|
+
with:
|
|
21
|
+
components: rustfmt
|
|
22
|
+
- run: cargo fmt --all --check
|
|
23
|
+
|
|
24
|
+
test:
|
|
25
|
+
name: Test (${{ matrix.os }})
|
|
26
|
+
runs-on: ${{ matrix.os }}
|
|
27
|
+
strategy:
|
|
28
|
+
fail-fast: false
|
|
29
|
+
matrix:
|
|
30
|
+
os: [ubuntu-latest, macos-latest]
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
34
|
+
- uses: Swatinem/rust-cache@v2
|
|
35
|
+
with:
|
|
36
|
+
key: ${{ matrix.os }}
|
|
37
|
+
- name: Build
|
|
38
|
+
run: cargo build --verbose
|
|
39
|
+
- name: Run unit & integration tests
|
|
40
|
+
run: cargo test --verbose
|
|
41
|
+
- name: Run tests with FFI feature
|
|
42
|
+
run: cargo test --features ffi --verbose
|
|
43
|
+
- name: Run tests in release mode
|
|
44
|
+
run: cargo test --release --verbose
|
|
45
|
+
|
|
46
|
+
swift-ffi:
|
|
47
|
+
name: Swift FFI Tests
|
|
48
|
+
runs-on: macos-latest
|
|
49
|
+
needs: test
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
53
|
+
with:
|
|
54
|
+
targets: aarch64-apple-darwin
|
|
55
|
+
- uses: Swatinem/rust-cache@v2
|
|
56
|
+
with:
|
|
57
|
+
key: swift-ffi
|
|
58
|
+
- name: Build static library for Swift
|
|
59
|
+
run: cargo build --release --features "ffi,fst-engine" --target aarch64-apple-darwin
|
|
60
|
+
- name: Run Swift FFI smoke test
|
|
61
|
+
working-directory: swift-test
|
|
62
|
+
run: swift run NemoTest
|
|
63
|
+
|
|
64
|
+
wasm:
|
|
65
|
+
name: WASM
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v4
|
|
69
|
+
- uses: actions/setup-node@v4
|
|
70
|
+
with:
|
|
71
|
+
node-version: 22
|
|
72
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
73
|
+
with:
|
|
74
|
+
targets: wasm32-unknown-unknown
|
|
75
|
+
- uses: Swatinem/rust-cache@v2
|
|
76
|
+
with:
|
|
77
|
+
key: wasm
|
|
78
|
+
- uses: jetli/wasm-pack-action@v0.4.0
|
|
79
|
+
- run: npm run wasm:ci
|
|
80
|
+
|
|
81
|
+
fst-engine:
|
|
82
|
+
name: FST Engine Parity (TN 8 langs, ITN 7 langs vs NeMo)
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/checkout@v4
|
|
86
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
87
|
+
- uses: Swatinem/rust-cache@v2
|
|
88
|
+
with:
|
|
89
|
+
key: fst-engine
|
|
90
|
+
# Runs the bundled NeMo-golden fixtures through the FST engine and asserts
|
|
91
|
+
# byte-exact parity for zh, fr, ja, en, hi, es, de, it. Release mode keeps the
|
|
92
|
+
# big-grammar languages (hi, es) fast.
|
|
93
|
+
- name: Run FST-engine parity tests
|
|
94
|
+
run: cargo test --release --features fst-engine --test fst_parity -- --nocapture
|
|
95
|
+
# Source-aligned TN over the same fixtures, plus its C FFI surface.
|
|
96
|
+
- name: Run FST-engine alignment tests
|
|
97
|
+
run: cargo test --release --features ffi,fst-engine --test fst_alignment
|
|
98
|
+
- name: Run FST-engine ITN parity tests
|
|
99
|
+
run: cargo test --release --features fst-engine --test fst_itn_parity
|
|
100
|
+
- name: Run default-engine routing tests
|
|
101
|
+
run: cargo test --release --features ffi,fst-engine --test default_engine --lib
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Publish Crate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
16
|
+
|
|
17
|
+
# crates.io and npm publish from the same tag, so the tag must match
|
|
18
|
+
# Cargo.toml (#103: crates.io sat at 0.2.2 while npm moved on).
|
|
19
|
+
- name: Check version
|
|
20
|
+
id: version
|
|
21
|
+
run: |
|
|
22
|
+
version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
|
|
23
|
+
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
|
|
24
|
+
echo "Tag $GITHUB_REF_NAME does not match Cargo.toml version $version"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
28
|
+
|
|
29
|
+
# A version already on crates.io is skipped, so a re-run, or a release
|
|
30
|
+
# published by hand, doesn't fail the job.
|
|
31
|
+
- name: Publish
|
|
32
|
+
env:
|
|
33
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
34
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
35
|
+
run: |
|
|
36
|
+
if curl -sf -A "text-processing-rs release workflow" \
|
|
37
|
+
"https://crates.io/api/v1/crates/text-processing-rs/$VERSION" >/dev/null; then
|
|
38
|
+
echo "text-processing-rs@$VERSION is already on crates.io; nothing to publish."
|
|
39
|
+
else
|
|
40
|
+
cargo publish
|
|
41
|
+
fi
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Publish WASM Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
# npm trusted publishing authenticates with the job's OIDC token.
|
|
14
|
+
id-token: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: 22
|
|
21
|
+
registry-url: "https://registry.npmjs.org"
|
|
22
|
+
|
|
23
|
+
# Trusted publishing needs npm 11.5.1 or newer; Node 22 ships npm 10.
|
|
24
|
+
- run: npm install -g npm@latest
|
|
25
|
+
|
|
26
|
+
- uses: jetli/wasm-pack-action@v0.4.0
|
|
27
|
+
|
|
28
|
+
- run: rustup target add wasm32-unknown-unknown
|
|
29
|
+
- run: npm run wasm:ci
|
|
30
|
+
# Authenticates through npm trusted publishing, configured for this
|
|
31
|
+
# workflow on npmjs.com. A version already on npm is skipped, so a
|
|
32
|
+
# re-run, or a release published by hand, doesn't fail the job.
|
|
33
|
+
- name: Publish
|
|
34
|
+
run: |
|
|
35
|
+
name=$(node -p "require('./pkg-web/package.json').name")
|
|
36
|
+
version=$(node -p "require('./pkg-web/package.json').version")
|
|
37
|
+
if npm view "$name@$version" version >/dev/null 2>&1; then
|
|
38
|
+
echo "$name@$version is already on npm; nothing to publish."
|
|
39
|
+
else
|
|
40
|
+
npm run wasm:publish
|
|
41
|
+
fi
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: NeMo Parity
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
# Pinned NeMo-text-processing commit so the parity number only moves when
|
|
12
|
+
# our code changes (bump deliberately, then regenerate the baseline).
|
|
13
|
+
NEMO_REF: 1f1263579fe57ba7ed783cad3dddee710fcc5064
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
parity:
|
|
17
|
+
name: NeMo Parity (report + regression guard)
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
- uses: Swatinem/rust-cache@v2
|
|
23
|
+
with:
|
|
24
|
+
key: parity
|
|
25
|
+
|
|
26
|
+
- name: Fetch NeMo test data (pinned, sparse)
|
|
27
|
+
run: |
|
|
28
|
+
git clone --filter=blob:none --no-checkout \
|
|
29
|
+
https://github.com/NVIDIA/NeMo-text-processing.git nemo
|
|
30
|
+
cd nemo
|
|
31
|
+
git sparse-checkout init --cone
|
|
32
|
+
git sparse-checkout set tests/nemo_text_processing
|
|
33
|
+
git checkout "$NEMO_REF"
|
|
34
|
+
|
|
35
|
+
- name: Run parity check
|
|
36
|
+
run: |
|
|
37
|
+
NEMO_DIR="$GITHUB_WORKSPACE/nemo" \
|
|
38
|
+
cargo run --release --example parity | tee "$GITHUB_STEP_SUMMARY"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
name: Python release wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: python-release-${{ github.event.release.id }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
if: startsWith(github.event.release.tag_name, 'v')
|
|
17
|
+
runs-on: ${{ matrix.runner }}
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
include:
|
|
22
|
+
- runner: ubuntu-24.04
|
|
23
|
+
target: x86_64-unknown-linux-gnu
|
|
24
|
+
manylinux: '2_28'
|
|
25
|
+
sdist: --sdist
|
|
26
|
+
- runner: ubuntu-24.04-arm
|
|
27
|
+
target: aarch64-unknown-linux-gnu
|
|
28
|
+
manylinux: '2_28'
|
|
29
|
+
- runner: macos-15
|
|
30
|
+
target: aarch64-apple-darwin
|
|
31
|
+
- runner: macos-15-intel
|
|
32
|
+
target: x86_64-apple-darwin
|
|
33
|
+
- runner: windows-2022
|
|
34
|
+
target: x86_64-pc-windows-msvc
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
with:
|
|
38
|
+
ref: ${{ github.sha }}
|
|
39
|
+
persist-credentials: false
|
|
40
|
+
- uses: actions/setup-python@v5
|
|
41
|
+
with:
|
|
42
|
+
python-version: '3.12'
|
|
43
|
+
- name: Build distribution
|
|
44
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
|
|
45
|
+
with:
|
|
46
|
+
target: ${{ matrix.target }}
|
|
47
|
+
manylinux: ${{ matrix.manylinux }}
|
|
48
|
+
maturin-version: v1.16.0
|
|
49
|
+
args: >-
|
|
50
|
+
--locked --release --compatibility pypi --out dist
|
|
51
|
+
--features python,pyo3/abi3-py39 ${{ matrix.sdist }}
|
|
52
|
+
- name: Test installed wheel
|
|
53
|
+
shell: bash
|
|
54
|
+
run: |
|
|
55
|
+
python -m pip install --no-deps dist/*.whl
|
|
56
|
+
python -I scripts/check-python-wheel.py
|
|
57
|
+
- uses: actions/upload-artifact@v4
|
|
58
|
+
with:
|
|
59
|
+
name: dist-${{ matrix.target }}
|
|
60
|
+
path: dist/
|
|
61
|
+
if-no-files-found: error
|
|
62
|
+
|
|
63
|
+
attach:
|
|
64
|
+
needs: build
|
|
65
|
+
runs-on: ubuntu-24.04
|
|
66
|
+
permissions:
|
|
67
|
+
contents: write
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/download-artifact@v4
|
|
70
|
+
with:
|
|
71
|
+
pattern: dist-*
|
|
72
|
+
merge-multiple: true
|
|
73
|
+
path: dist
|
|
74
|
+
- name: Attach distributions to the release
|
|
75
|
+
env:
|
|
76
|
+
GH_TOKEN: ${{ github.token }}
|
|
77
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
78
|
+
RELEASE_ID: ${{ github.event.release.id }}
|
|
79
|
+
run: |
|
|
80
|
+
uploaded=$(gh api "repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets" --paginate \
|
|
81
|
+
--jq '.[] | select(.state == "uploaded") | .name')
|
|
82
|
+
for file in dist/*.whl dist/*.tar.gz; do
|
|
83
|
+
name=${file##*/}
|
|
84
|
+
if grep -Fxq -- "$name" <<< "$uploaded"; then
|
|
85
|
+
printf 'Already attached %s\n' "$name"
|
|
86
|
+
else
|
|
87
|
+
gh release upload "$RELEASE_TAG" "$file" --repo "$GITHUB_REPOSITORY"
|
|
88
|
+
fi
|
|
89
|
+
done
|
|
90
|
+
|
|
91
|
+
publish-pypi:
|
|
92
|
+
name: Publish to PyPI
|
|
93
|
+
needs: attach
|
|
94
|
+
runs-on: ubuntu-24.04
|
|
95
|
+
environment:
|
|
96
|
+
name: pypi
|
|
97
|
+
url: https://pypi.org/project/text-processing-rs/
|
|
98
|
+
permissions:
|
|
99
|
+
id-token: write
|
|
100
|
+
steps:
|
|
101
|
+
- uses: actions/download-artifact@v4
|
|
102
|
+
with:
|
|
103
|
+
pattern: dist-*
|
|
104
|
+
merge-multiple: true
|
|
105
|
+
path: dist
|
|
106
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
107
|
+
with:
|
|
108
|
+
packages-dir: dist
|
|
109
|
+
skip-existing: true
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: XCFramework
|
|
2
|
+
|
|
3
|
+
# Builds NemoTextProcessing.xcframework (macOS universal + iOS device + iOS
|
|
4
|
+
# simulator universal + Mac Catalyst universal) so Apple consumers (e.g.
|
|
5
|
+
# FluidAudio) can link the native FFI via a SwiftPM `.binaryTarget(url:checksum:)`
|
|
6
|
+
# instead of hand-linking the lib.
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["v*"]
|
|
10
|
+
# Validate the build itself when the workflow or build inputs change; the
|
|
11
|
+
# release-upload step is tag-gated so PR runs only produce a CI artifact.
|
|
12
|
+
pull_request:
|
|
13
|
+
paths:
|
|
14
|
+
- ".github/workflows/xcframework.yml"
|
|
15
|
+
- "build-xcframework.sh"
|
|
16
|
+
- "swift/**"
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: write
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
xcframework:
|
|
24
|
+
name: Build & publish xcframework
|
|
25
|
+
runs-on: macos-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
30
|
+
with:
|
|
31
|
+
targets: aarch64-apple-darwin,x86_64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios,aarch64-apple-ios-macabi,x86_64-apple-ios-macabi
|
|
32
|
+
|
|
33
|
+
- name: Build xcframework
|
|
34
|
+
run: ./build-xcframework.sh
|
|
35
|
+
|
|
36
|
+
- name: Package + checksum
|
|
37
|
+
working-directory: output
|
|
38
|
+
run: |
|
|
39
|
+
zip -ry NemoTextProcessing.xcframework.zip NemoTextProcessing.xcframework
|
|
40
|
+
# SwiftPM binary-target checksum is the SHA-256 of the zip.
|
|
41
|
+
shasum -a 256 NemoTextProcessing.xcframework.zip | cut -d' ' -f1 \
|
|
42
|
+
> NemoTextProcessing.xcframework.zip.checksum
|
|
43
|
+
echo "checksum: $(cat NemoTextProcessing.xcframework.zip.checksum)"
|
|
44
|
+
|
|
45
|
+
- name: Upload build artifact
|
|
46
|
+
uses: actions/upload-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: NemoTextProcessing-xcframework
|
|
49
|
+
path: |
|
|
50
|
+
output/NemoTextProcessing.xcframework.zip
|
|
51
|
+
output/NemoTextProcessing.xcframework.zip.checksum
|
|
52
|
+
output/NemoTextProcessing.swift
|
|
53
|
+
|
|
54
|
+
- name: Attach to release
|
|
55
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
56
|
+
env:
|
|
57
|
+
GH_TOKEN: ${{ github.token }}
|
|
58
|
+
run: |
|
|
59
|
+
gh release upload "${GITHUB_REF_NAME}" \
|
|
60
|
+
output/NemoTextProcessing.xcframework.zip \
|
|
61
|
+
output/NemoTextProcessing.xcframework.zip.checksum \
|
|
62
|
+
output/NemoTextProcessing.swift --clobber
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# text-processing-rs - Agent Development Guide
|
|
2
|
+
|
|
3
|
+
## Build & Test Commands
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cargo build # Build project
|
|
7
|
+
cargo build --release # Release build
|
|
8
|
+
cargo build --features ffi # Build with C FFI bindings
|
|
9
|
+
cargo build --features wasm --target wasm32-unknown-unknown # Build for WebAssembly
|
|
10
|
+
cargo build --features fst-engine # Build the optional compiled NeMo FST TN engine
|
|
11
|
+
cargo test # Run all tests
|
|
12
|
+
cargo test --test en_tests # Run a single integration test file
|
|
13
|
+
cargo test en_tn_tests::test_name # Run a single test by name
|
|
14
|
+
cargo fmt # Format code
|
|
15
|
+
cargo clippy --all-targets # Lint
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Architecture
|
|
19
|
+
|
|
20
|
+
- **src/itn/**: ITN taggers (spoken → written, Inverse Text Normalization) per language (en, de, es, fr, hi, ja, zh)
|
|
21
|
+
- **src/tn/**: TN taggers (written → spoken, Text Normalization)
|
|
22
|
+
- **src/fst/**: Optional compiled NeMo FST TN engine and source-aligned TN spans, gated by `fst-engine`
|
|
23
|
+
- **src/custom_rules.rs**: User-defined custom normalization rules (highest priority)
|
|
24
|
+
- **src/ffi.rs**: C FFI bindings for Swift/Python integration (gated by `ffi` feature)
|
|
25
|
+
- **src/wasm.rs**: JavaScript-callable wasm bindings (gated by `wasm` feature)
|
|
26
|
+
- **src/lib.rs**: Public API entry point — `normalize()` dispatches to taggers in specificity order
|
|
27
|
+
- **tests/**: Integration tests (per-language ITN/TN suites + `extensive_tests.rs` edge cases)
|
|
28
|
+
- **swift/**, **swift-test/**: Swift consumer package and tests for the FFI surface
|
|
29
|
+
- **wasm-tests/**: Browser/Node tests against the wasm build
|
|
30
|
+
- **scripts/**: Build helpers (e.g. `set-wasm-package-name.mjs`)
|
|
31
|
+
- **build-xcframework.sh**: Builds an `.xcframework` for Apple platform consumers
|
|
32
|
+
|
|
33
|
+
### Processing Pipeline
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
input → custom_rules → whitelist → punctuation → word → time → telephone → ... → output
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Taggers are tried in order of specificity (most specific first). If no tagger matches, the original text is returned.
|
|
40
|
+
|
|
41
|
+
## Critical Rules
|
|
42
|
+
|
|
43
|
+
- **NEVER** run `git push` unless explicitly requested by the user
|
|
44
|
+
- **NEVER** add `Co-Authored-By` lines for Claude, Copilot, or any AI assistant in commit messages
|
|
45
|
+
- **NEVER** create simplified or stub versions — implement full solutions or consult first
|
|
46
|
+
- **NEVER** introduce mock data or fabricated test cases — use realistic spoken/written forms
|
|
47
|
+
- Add unit/integration tests when adding new taggers or rules
|
|
48
|
+
- Keep language-specific rule changes local to `src/itn/<lang>/` or `src/tn/<lang>/`; keep compiled-FST behavior in `src/fst/` and its bindings in the corresponding consumer surfaces
|
|
49
|
+
- Maintain feature-flag isolation: `ffi`, `wasm`, and `fst-engine` code and dependencies must not leak into the default build
|
|
50
|
+
|
|
51
|
+
## Code Style (rustfmt + clippy)
|
|
52
|
+
|
|
53
|
+
- Use `cargo fmt` before committing — defaults to standard rustfmt rules
|
|
54
|
+
- Use `snake_case` for functions/variables, `UpperCamelCase` for types, `SCREAMING_SNAKE_CASE` for consts
|
|
55
|
+
- Public APIs: document with `///` doc comments and include runnable examples where practical
|
|
56
|
+
- Error handling: prefer `Option`/`Result`; avoid `unwrap()`/`expect()` in library code
|
|
57
|
+
- Control flow: prefer early returns and flat structure over nested conditionals
|
|
58
|
+
- Imports: group `std`, external crates, and local modules separately
|
|
59
|
+
- Keep tagger functions small and focused — one tagger per spoken-form pattern
|
|
60
|
+
|
|
61
|
+
## Clean Code
|
|
62
|
+
|
|
63
|
+
- Maintain API consistency across language taggers (each tagger exposes `parse(&str) -> Option<String>`)
|
|
64
|
+
- Single responsibility per file: one tagger category per module (e.g. `cardinal.rs`, `date.rs`, `money.rs`)
|
|
65
|
+
- New languages should mirror the existing `itn::en` module layout
|
|
66
|
+
- When extending the public API, update `lib.rs`, FFI bindings (`ffi.rs`), and wasm bindings (`wasm.rs`) together so all consumers stay in sync
|
|
67
|
+
|
|
68
|
+
## FFI / Bindings
|
|
69
|
+
|
|
70
|
+
- C FFI lives in `src/ffi.rs` behind the `ffi` feature; consumed by the Swift package in `swift/`
|
|
71
|
+
- Wasm bindings live in `src/wasm.rs` behind the `wasm` feature; consumed by `wasm-tests/`
|
|
72
|
+
- Compiled-FST alignment uses `fst::normalize_aligned` and half-open UTF-8 byte offsets; its Rust API is gated by `fst-engine`, and its C/WASM exports must preserve the same contract
|
|
73
|
+
- Run `cargo build --features ffi` and the Swift tests under `swift-test/` after touching FFI signatures
|
|
74
|
+
- Run the wasm test suite after touching `wasm.rs` or anything affecting the wasm-exposed surface
|
|
75
|
+
|
|
76
|
+
## Mobius Plan
|
|
77
|
+
|
|
78
|
+
Consult `PLANS.md` (when present) for complex tasks; plan changes first. Store plans in a local `.mobius/` folder without committing to GitHub.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
## Git Operations
|
|
4
|
+
|
|
5
|
+
- Never run `git push` unless explicitly requested
|
|
6
|
+
- No Co-Author tags: Do not add `Co-Authored-By` lines for Claude, Copilot, or any AI assistant in commit messages
|
|
7
|
+
|
|
8
|
+
## Build Commands
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
cargo build
|
|
12
|
+
cargo test
|
|
13
|
+
cargo fmt
|
|
14
|
+
cargo build --features ffi
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Project Structure
|
|
18
|
+
|
|
19
|
+
- `src/itn/` - ITN taggers (spoken to written, Inverse Text Normalization)
|
|
20
|
+
- `src/tn/` - TN taggers (written to spoken, Text Normalization)
|
|
21
|
+
- `src/custom_rules.rs` - User-defined custom normalization rules
|
|
22
|
+
- `src/ffi.rs` - C FFI bindings for Swift/Python integration
|
|
23
|
+
- `tests/` - Integration and extensive edge-case tests
|