Skip to content

fix: read digit-grouped numbers outside of Measure - #404

Merged
pengzhendong merged 1 commit into
wenet-e2e:masterfrom
b84330808:fix-zh-grouped-numbers
Nov 6, 2026
Merged

pengzhendong merged 1 commit into
wenet-e2e:masterfrom
b84330808:fix-zh-grouped-numbers

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

Measure strips commas between digits, but nothing else does, so a grouped number comes out wrong unless a known unit follows:

跑了15,000公尺  跑了十五,零零零公尺
卖出3,791台     卖出三,七百九十一台
全长1,000,000   全长一,零零零,零零零
价格是$1,000    价格是一美元,零零零

This adds the 1,000 form to Cardinal.number, so Math, Money and the others get it too. Only groups of exactly three digits count, so 选1,2,3 and 1,2345 stay separate numbers.

One thing that changes: 100,200 now reads as 十万零二百 instead of two numbers. Measure already reads it that way before a unit.

The new cases fail without the change. After rebasing on #402, the full pytest run passes on macOS (27196 passed), from unittest.yml on my fork. The Ubuntu job can't run at the moment: ubuntu-latest is now 26.04, which has no Python 3.9, so setup fails before any test.

Only Measure stripped commas between digits, so 15,000公尺 became
十五,零零零公尺 and $1,000 became 一美元,零零零. Accept groups of exactly three
digits in Cardinal.number.
@pengzhendong
pengzhendong merged commit b2e5282 into wenet-e2e:master Nov 6, 2026
1 check 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.

2 participants