Skip to content

feat: add English ITN core rules (cardinal, ordinal, decimal)#355

Merged
pengzhendong merged 3 commits into
masterfrom
feat/en-itn-core
Jun 9, 2026
Merged

feat: add English ITN core rules (cardinal, ordinal, decimal)#355
pengzhendong merged 3 commits into
masterfrom
feat/en-itn-core

Conversation

@pengzhendong

@pengzhendong pengzhendong commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Add core English inverse text normalization rules:

  • Cardinal: up to sextillion, eleven hundred pattern, minus/negative, and-deletion
  • Ordinal: first→1st, second→2nd, thirteenth→13th, twenty first→21st
  • Decimal: twelve point five→12.5, point o five→.05, minus three point one four→-3.14
  • Char: fallback for unmatched characters

Examples

from itn.english.rules.inverse_normalizer import InverseNormalizer
n = InverseNormalizer()
n.normalize("twenty three")                    # 23
n.normalize("one hundred and one")             # 101
n.normalize("eleven hundred")                  # 1100
n.normalize("minus forty two")                 # -42
n.normalize("first")                           # 1st
n.normalize("twelve point five")               # 12.5
n.normalize("hello world twenty three")        # hello world 23

NeMo cardinal test: 27/29 passed.

Test plan

  • All 1400 unit tests pass
  • CI passes

Add core English inverse text normalization rules:
- Cardinal: supports up to sextillion, eleven hundred pattern,
  minus/negative, and/deletion
- Ordinal: first=>1st, second=>2nd, thirteenth=>13th, etc.
- Decimal: twelve point five => 12.5, point o five => .05
- Char: fallback for unmatched characters

NeMo cardinal test: 27/29 passed (missing: zero preservation,
Indian numeric format)
@pengzhendong pengzhendong merged commit 91b68ae into master Jun 9, 2026
1 check passed
@pengzhendong pengzhendong deleted the feat/en-itn-core branch June 9, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant