Repository navigation
fix(itn): sentence-mode accuracy fixes for en, fr and de - #93
Merged
Alex-Wengg merged 2 commits intoOct 14, 2026
Merged
Conversation
Handle hyphenated numbers, mixed fractions, "oh" digit sequences and long cardinals; stop fabricating times from ranges and dropping "and" between quantities; avoid a doubled period after p.m.; read "cent onzième" as an ordinal; add "pour cent" and "prozent" percentages.
Member
|
Thanks, this reproduces cleanly here and the parity run is clean. One blocker: the "oh" branch in parse_span turns bare times into digits in sentence mode ("meet me at nine oh five" → "905", main gives "09:05"), while single-expression mode still gives 09:05. Could you drop that branch and its test from this PR (room numbers need preceding-token context, happy to take that as a follow-up) and refresh tests/parity_baseline.tsv for the fr ordinal 22→23? The rest looks good to merge. |
The branch read bare times as digits ("nine oh five" -> "905").
Room numbers need preceding-token context; leave that for a follow-up.
Add a regression test for the time case and record fr ITN ordinal 23/23.
Contributor
Author
|
Thanks for catching that. Pushed 7bfaee7:
|
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.
We hit these bugs while dictating with Speakmac, which uses this crate for on-device number formatting:
Two existing tests asserted the old output, and their comments already flagged it as a known issue:
test_sentence_mixed_punctuation_and_numbersandtest_sentence_itn_multiple_numbers. Both are updated.How
max_span_tokensalready bounds the search. A single period right after a tagger output that already ends in "." (such as "p.m.") is dropped; ellipses are kept.pour centandprozent→%.Testing
cargo test: 1,172 passed, 0 failed.cargo test --features ffi: 1,180 passed.cargo fmt --all --checkis clean, andcargo clippy --all-targetsreports no new warnings.en_tests.rsandmultilang_itn_tests.rscover every row in the table above.examples/parityagainst NeMo at the pinned ref1f12635(tests/parity_baseline.tsvupdated):Scope
🤖 Generated with Claude Code