Skip to content

fix: read 110, 120, etc. as phone numbers only when the context says so - #402

Merged
pengzhendong merged 1 commit into
wenet-e2e:masterfrom
b84330808:fix-zh-phone-context
Nov 5, 2026
Merged

pengzhendong merged 1 commit into
wenet-e2e:masterfrom
b84330808:fix-zh-phone-context

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

110, 120 and the other 3-digit numbers in phone.tsv are read digit by digit unless a known unit follows, so ordinary quantities come out as phone numbers:

共120题      共幺二零题
跑了110公尺  跑了幺幺零公尺
总分是120    总分是幺二零

This keeps the digit reading only next to a word that marks a phone number: a verb before it (拨打, 打, 呼叫, ...) or a word after it (急救, 报警, 电话, ...). The words are in two new TSV files, so it's easy to add more. Anything else reads as a number, the same direction as #351 and #353.

  • A bare 110 is now 一百一十, since nothing says it's a phone number. I changed the cardinal.txt case to 拨打110. If you'd rather keep the old reading for a whole input of just 110, let me know.
  • 5-digit service numbers like 12306 are unchanged, since they're rarely quantities.
  • 打120分 is still a score, because the 分 unit wins.

The new cases fail without the change, and pytest tn/chinese/test passes with it.

Any 3-digit number from phone.tsv was read digit by digit unless a known
unit followed, so 共120题 became 共幺二零题 and 跑了110公尺 became 跑了幺幺零公尺.
Keep that reading only next to a word that marks a phone number, and read
the rest as numbers. 5-digit service numbers are unchanged.
@pengzhendong
pengzhendong merged commit a96f133 into wenet-e2e:master Nov 5, 2026
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