Add punctuation tagger, custom rules, and comprehensive edge case tests#1
Merged
Alex-Wengg merged 3 commits intomainfrom Feb 13, 2026
Merged
Conversation
Adds normalize_sentence() and normalize_sentence_with_max_span() that scan for normalizable spans within larger sentences using a longest-match-first sliding window. Includes FFI exports and integration tests.
- Punctuation tagger: 30+ spoken→symbol mappings (exact match only to avoid false positives) - Custom rules: runtime-configurable spoken→written mappings with highest priority (RwLock thread-safe) - FFI exports: nemo_normalize_sentence, custom rules API, wired into C header - Swift wrapper: updated with sentence-mode, custom rules, and rule management API - Swift test harness: NLTagger edge case verification (10 tests) - Edge case tests: ASR-realistic dictation, large numbers, negative numbers, multi-type sentences, punctuation in dictation, ordinal false positives, money/time edge cases, special values (143 total tests)
- GitHub Actions CI: cargo fmt --check + cargo test (with and without ffi feature) - Apply default rustfmt formatting across all source files
cc26706 to
66fb1da
Compare
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.
Summary
nemo_normalize_sentence,nemo_add_rule,nemo_remove_rule,nemo_clear_rules,nemo_rule_count+ C header updatesTest plan
cargo test— all 143 tests pass (83 unit + 57 integration + 3 doc)🤖 Generated with Claude Code