From ffb3a2189f1c73c2f64503805c6d6cdeb348e3bf Mon Sep 17 00:00:00 2001 From: Naxvog Date: Wed, 14 Oct 2026 21:27:17 +0200 Subject: [PATCH] Hyphenation: exact German pattern count, a parser test for skipped commands Co-Authored-By: Claude Opus 5.5 --- ROADMAP.md | 2 +- crates/proof/src/hyphen.rs | 2 +- crates/proof/src/patterns.rs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index aa6ff7ede..7547737b1 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -114,7 +114,7 @@ Weights and evidence per area: [docs/target-app-parity.md](docs/target-app-parit | Vietnamese | vi | partial (#1434) | ~95% | Also shipped: Traditional Chinese (`zh-hant`), Ukrainian (`uk`), Serbian (`sr`, `sr-latn`, #250), Russian (`ru`) and Polish (`pl`), all partial (~95%). Bulgarian (`bg`) covers everything the interface audit finds (2,419 entries); Swedish (`sv`) covers that too, plus 44 newer strings no other catalog has yet (2,504 entries). Estonian (`et`), Italian (`it`, #594) and Czech (`cs`) now have complete interface catalogs, and Turkish (`tr`) a complete 2,325-entry one (every key of the Russian catalog), all with -system-locale selection and a saved language choice (Italian also has 51 strings none of the others had yet); Estonian, Turkish and Italian proofing are not included. Hungarian (`hu`) has a +system-locale selection and a saved language choice (Italian also has 51 strings none of the others had yet); Estonian proofing is not included. Hungarian (`hu`) has a complete 2,419-entry catalog, also without proofing. Vietnamese (`vi`, #1434) has a complete 2,448-entry catalog, also without proofing. Proofing: English, Polish, Portuguese, Italian, Croatian, Turkish and Russian (spelling, grammar; hyphenation except Croatian), plus Czech and Indonesian (system Hunspell spelling, generic checks), chosen per run from its language; Bulgarian and German hyphenation only. Word ships diff --git a/crates/proof/src/hyphen.rs b/crates/proof/src/hyphen.rs index 1db67eb02..00297331e 100644 --- a/crates/proof/src/hyphen.rs +++ b/crates/proof/src/hyphen.rs @@ -861,7 +861,7 @@ mod tests { #[test] fn german_patterns_load() { let p = Patterns::de(); - assert!(p.len() >= 36_709, "{}", p.len()); + assert_eq!(p.len(), 36_709); // The file has no exception words, and its `\message{…}` line adds none. assert_eq!(p.exception_count(), 0); } diff --git a/crates/proof/src/patterns.rs b/crates/proof/src/patterns.rs index 08d54a947..a91235e48 100644 --- a/crates/proof/src/patterns.rs +++ b/crates/proof/src/patterns.rs @@ -142,6 +142,7 @@ impl Patterns { block = match name { "hyphenation" => Block::Exceptions, "patterns" => Block::Patterns, + // shortcut: the argument ends at the first `}`, so nested braces would leak; no bundled file has them. _ if cmd.contains('{') => Block::Skip, _ => Block::Patterns, }; @@ -345,6 +346,12 @@ mod tests { assert!(p.to_tex().contains(&".ab4cdefghijklm5n".to_string())); } + #[test] + fn other_commands_arguments_are_skipped() { + let p = Patterns::parse("\\message{Some Patterns `x-y' 2024-02-28}\n\\patterns{%\na1b\n}\n\\endinput\n"); + assert_eq!((p.len(), p.exception_count()), (1, 0)); + } + #[test] fn apply_tolerates_short_value_buffers() { let p = Patterns::parse("a1b");