Skip to content

fix: add missing space between comma-separated digit groups#342

Merged
pengzhendong merged 1 commit into
masterfrom
fix/threetwo-comma-digits
Jun 9, 2026
Merged

fix: add missing space between comma-separated digit groups#342
pengzhendong merged 1 commit into
masterfrom
fix/threetwo-comma-digits

Conversation

@pengzhendong

@pengzhendong pengzhendong commented Jun 9, 2026

Copy link
Copy Markdown
Member

Closes #291 (the threetwo bug)

Summary

Fix missing space between digit groups in single_digits_graph_with_commas. Numbers like 0,013,225 were normalized to oh zero one threetwo two five — the last digit of one group and the first digit of the next were concatenated.

Before: 0,013,225oh zero one threetwo two five
After: 0,013,225oh zero one three two two five

Regarding the speed question in the issue: English TN is slower than Chinese TN (~17ms vs ~3ms) because the English FST has significantly more states (larger rule set, non-deterministic mode). The recent refactoring (#333) already improved build time by 4x. Runtime compose+shortestpath cost is proportional to FST size and hard to optimize further without simplifying the grammar.

Test plan

  • All 1400 unit tests pass
  • CI passes

#291)

Numbers like 0,013,225 were normalized to "oh zero one threetwo two
five" with "three" and "two" concatenated. The comma-separated digit
groups in single_digits_graph_with_commas lacked a space separator
between groups.
@pengzhendong pengzhendong merged commit 60fab50 into master Jun 9, 2026
1 check passed
@pengzhendong pengzhendong deleted the fix/threetwo-comma-digits branch June 9, 2026 09:07
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.

关于中英文TN的速度问题

1 participant