Repository navigation
A figure followed by 余 or 多 is a bound and not a value, so "5000余万元" is no value instead of 5000 - #1441
Open
rudycelekli wants to merge 1 commit into
Open
A figure followed by 余 or 多 is a bound and not a value, so "5000余万元" is no value instead of 5000#1441rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
…is no value instead of 5000 Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
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.
Why
strip_approxdocuments the rule: 约 / 左右 only say a number is approximate, so the number stays; 超过 / 余 state a bound, and "把界当成值就是一条原文没说的断言". 超过 sits in front of the number and is never stripped, so "超过一千人" is no value. 余 and its everyday twin 多 sit after the number, between it and the magnitude: "5000余万元" (more than 50 million yuan), "300多人".scan_quantitystops the number at 余, cannot read "余万元" as a magnitude, and the lenient path keeps the bare 5000 with "余万元" as a unit word:"5000余万元"under a number attribute (no unit, or 元) is stored as 5000: four orders of magnitude off, and a lower bound recorded as the value."5000多万元"under 万元 is stored as 5000, and"300多人"under 人 as 300, both bounds recorded as exact counts.What changes
If the text right after the number starts with 余 or 多,
scan_quantityreturns no quantity, the same outcome "超过一千人" already has. Plain figures ("300人", "5000万元") are unchanged.How it was checked
a_figure_followed_by_yu_or_duo_is_a_bound_not_a_value, covers "5000余万元" with no unit and under 元, "5000多万元" under 万元, "300多人" under 人, and "300人" still reading 300.left: Some(Number(5000.0)) right: None.cargo test -p utopia-extract --lib: 113 passed.cargo fmt -p utopia-extract --checkandcargo clippy -p utopia-extract --all-targets -- -D warningspass.Before review
git commit -s)cargo fmt --all --check,cargo clippyandcargo testpass for the touched crate