fix: disambiguate X点零Y between time and decimal in Chinese ITN#343
Merged
Conversation
"五点零三" was incorrectly parsed as time 5:03 instead of decimal 5.03. Fix: require "分" suffix or noon prefix (上午/下午/etc.) for time patterns with zero-prefixed minutes (零一~零九). Without either, these are now treated as decimals. - Split minute.tsv: move 零X entries to new minute_zero.tsv - Time tagger: 零X minutes without "分" only match with noon prefix Examples: 五点零三 => 5.03 (decimal, no context) 五点零三分 => 5:03 (time, has 分) 下午五点零三 => 5:03p.m. (time, has noon) 八点三十 => 8:30 (time, unambiguous)
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.
Closes #310
Summary
#310: Disambiguate "X点零Y" between time and decimal
"五点零三" was incorrectly parsed as time
5:03instead of decimal5.03. Fix: require分suffix or noon prefix for zero-prefixed minutes (零一~零九). Non-zero minutes (半, 三十, etc.) are unaffected.#309: Convert digit after 块 regardless of enable_0_to_9
十五块八withenable_0_to_9=Falsenow correctly outputs15块8instead of15块八. The digit after块is always converted as part of the monetary amount.Examples
Test plan