Repository navigation
fix: read digit-grouped numbers outside of Measure - #404
Merged
Merged
Conversation
Only Measure stripped commas between digits, so 15,000公尺 became 十五,零零零公尺 and $1,000 became 一美元,零零零. Accept groups of exactly three digits in Cardinal.number.
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.
Measurestrips commas between digits, but nothing else does, so a grouped number comes out wrong unless a known unit follows:This adds the
1,000form toCardinal.number, soMath,Moneyand the others get it too. Only groups of exactly three digits count, so选1,2,3and1,2345stay separate numbers.One thing that changes:
100,200now reads as十万零二百instead of two numbers.Measurealready reads it that way before a unit.The new cases fail without the change. After rebasing on #402, the full
pytestrun passes on macOS (27196 passed), fromunittest.ymlon my fork. The Ubuntu job can't run at the moment:ubuntu-latestis now 26.04, which has no Python 3.9, so setup fails before any test.