feat(i18n): locale-aware compress-md with pt-BR support#25
Merged
claudioemmanuel merged 1 commit intomainfrom Apr 7, 2026
Merged
feat(i18n): locale-aware compress-md with pt-BR support#25claudioemmanuel merged 1 commit intomainfrom
claudioemmanuel merged 1 commit intomainfrom
Conversation
- Convert compress_md.rs to module dir (mod.rs + locale.rs + locales/) - Add Locale struct with per-locale word lists (articles, fillers, hedges, phrases, conjunctions, ultra_subs); EN and pt-BR ship in v1 - Unicode-correct helpers: is_clean_word (char iter), replace_word_boundary (char-stream + to_lowercase), drop_phrase_ci (dual-cursor invariant), clean_mid_orphan_punct (post-phrase-drop cleanup) - Wire lang= config key and --lang CLI flag; resolution: CLI > config > en - Add 28 i18n integration tests (unit, feature, EN regression, cross-locale contract) + bench_i18n binary (ratio + latency) - PT-BR overhead: ~1.5x vs EN, still sub-millisecond per call - Update README with i18n benchmark table and before/after example Closes #24
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
compress_md.rsto a module dir withlocale.rs+locales/en.rs+locales/pt_br.rsLocalestruct with per-locale word lists (articles, fillers, hedges, phrases, conjunctions, ultra_subs)is_clean_word,replace_word_boundary(char-stream +to_lowercase),drop_phrase_ci(dual-cursor invariant),clean_mid_orphan_punctlang=config key and--lang <code>CLI flag; resolution: CLI > config >enbench_i18nbinaryBenchmarks
PT-BR overhead: ~1.5× vs EN, still sub-millisecond.
Before / after (pt-BR Full):
Test plan
cargo test— 315 tests, 38 suites, 0 failurescargo build --release— cleancargo run --release --bin bench_i18n— ratio + latency verifiedCloses #24