Repository navigation
fix: read 110, 120, etc. as phone numbers only when the context says so - #402
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
110,120and the other 3-digit numbers inphone.tsvare read digit by digit unless a known unit follows, so ordinary quantities come out as phone numbers: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.110is now一百一十, since nothing says it's a phone number. I changed thecardinal.txtcase to拨打110. If you'd rather keep the old reading for a whole input of just110, let me know.12306are 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/testpasses with it.