Skip to content

feat(tn/en/serial): alphanumeric serial codes (8→27) - #62

Merged
Alex-Wengg merged 1 commit into
mainfrom
feat/en-tn-serial
Jul 9, 2026
Merged

Alex-Wengg merged 1 commit into
mainfrom
feat/en-tn-serial

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Adds a serial tagger (sentence-mode priority 65, below cardinal, above word) for mixed letter/digit/symbol codes:

  • B2A23C → "B two A twenty three C"
  • 133-ABC → "one hundred thirty three-ABC"
  • $12@12% → "dollar twelve at twelve percent"
  • t-0t25d12-f → "t-zero t twenty five d twelve-f"

Letter runs are kept; digit runs read as cardinals (digit-by-digit with a leading zero or beyond four digits); - and / are kept literal and glue their neighbours, other symbols spell out. Requires a digit (pure-symbol tokens stay with the word tagger, which reads / as "slash"), and skips ARPABET phonemes (AH0).

Also tightens the telephone vanity detection (from #61) to 3+ groups with an upper-case mnemonic, so short mixed serials (133-ABC) and lower-case codes (1-413-te-b) no longer take the phone path.

en TN serial 8→27; bonus side wins normalize_with_audio 31→39, punctuation 34→35. No regressions.

The five unreproduced cases are NeMo's internally irregular forms (hyphen spaced in 1-8090, dropped in 7-eleven; 1/f→"one per F"; 4-digit 9453 digit-by-digit while 2000 is cardinal) — documented in the module header.

cargo test/fmt/clippy green; baseline regenerated (only increases).

🤖 Generated with Claude Code

Add a `serial` tagger (sentence-mode priority 65, below cardinal, above word)
for mixed letter/digit/symbol codes:
- "B2A23C" → "B two A twenty three C"
- "133-ABC" → "one hundred thirty three-ABC"
- "$12@12%" → "dollar twelve at twelve percent"

Letter runs are kept; digit runs read as cardinals (digit-by-digit with a
leading zero or beyond four digits); "-" and "/" are kept literal and glue,
other symbols spell out. Requires a digit (pure-symbol tokens stay with the
`word` tagger) and skips ARPABET phonemes ("AH0").

Also tighten telephone vanity detection to 3+ groups with an upper-case
mnemonic so short serials ("133-ABC") no longer take the phone path.

en TN serial 8→27; normalize_with_audio 31→39, punctuation 34→35 as side wins.
The five unreproduced cases are NeMo's irregular forms (hyphen spaced/dropped
in "1-8090"/"7-eleven", "1/f"→"one per F", 4-digit "9453" digit-by-digit). No
regressions.
@Alex-Wengg
Alex-Wengg merged commit eda6ffa into main Jul 9, 2026
6 checks passed
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