From 679c99cf66e999ec06128737a9c7dc6987d465e1 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 2 Dec 2024 09:10:05 -0600 Subject: [PATCH 1/2] test(dict): Consistenty filter out unverified entries --- crates/typos-dict/tests/verify.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/typos-dict/tests/verify.rs b/crates/typos-dict/tests/verify.rs index 2bc2131f8..7c2d1f756 100644 --- a/crates/typos-dict/tests/verify.rs +++ b/crates/typos-dict/tests/verify.rs @@ -203,7 +203,11 @@ fn varcon_words() -> HashSet> { fn proper_word_variants() -> HashMap<&'static str, HashSet<&'static str>> { let mut words: HashMap<&'static str, HashSet<&'static str>> = HashMap::new(); - for entry in varcon::VARCON.iter().flat_map(|c| c.entries.iter()) { + for entry in varcon::VARCON + .iter() + .filter(|c| c.verified) + .flat_map(|c| c.entries.iter()) + { let variants: HashSet<_> = entry .variants .iter() From 97bbab80c87e70d8bd9d6b6f45725c5193612f15 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 2 Dec 2024 09:13:41 -0600 Subject: [PATCH 2/2] fix(dict): Don't correct parametrized Fixes #1164 --- crates/typos-dict/assets/allowed.csv | 4 ++++ crates/typos-dict/assets/words.csv | 3 +-- crates/typos-dict/src/word_codegen.rs | 10 ++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/typos-dict/assets/allowed.csv b/crates/typos-dict/assets/allowed.csv index c74a3c7ea..06a0eac4b 100644 --- a/crates/typos-dict/assets/allowed.csv +++ b/crates/typos-dict/assets/allowed.csv @@ -50,3 +50,7 @@ tesselator,potentially US variant of tessellator additionals,additional looks like its sometimes a countable noun requestor,domain-specific variant of requester alloced,past tense of common programming abbreviation alloc +parametrization,accepted alternative to parameterization +parametrizations,accepted alternative to parameterizations +parametrized,accepted alternative to parameterized +parametrize,accepted alternative to parameterize diff --git a/crates/typos-dict/assets/words.csv b/crates/typos-dict/assets/words.csv index 5312e56bb..1585e3d2a 100644 --- a/crates/typos-dict/assets/words.csv +++ b/crates/typos-dict/assets/words.csv @@ -44903,8 +44903,6 @@ parametr,parameter parametre,parameter parametreless,parameterless parametres,parameters -parametrizations,parameterizations -parametrized,parameterized parametros,parameters parametrs,parameters parametter,parameter @@ -44924,6 +44922,7 @@ paramterised,parameterised paramterises,parameterises paramterising,parameterising paramterization,parametrization,parameterization +paramterizations,parametrizations,parameterizations paramterize,parameterize paramterized,parameterized paramterizes,parameterizes diff --git a/crates/typos-dict/src/word_codegen.rs b/crates/typos-dict/src/word_codegen.rs index ae2c6dcc3..2d48b6aa2 100644 --- a/crates/typos-dict/src/word_codegen.rs +++ b/crates/typos-dict/src/word_codegen.rs @@ -82100,6 +82100,7 @@ pub static WORD_PARAMT_CHILDREN: dictgen::DictTable<&'static [&'static str]> = d dictgen::InsensitiveStr::Ascii("erises"), dictgen::InsensitiveStr::Ascii("erising"), dictgen::InsensitiveStr::Ascii("erization"), + dictgen::InsensitiveStr::Ascii("erizations"), dictgen::InsensitiveStr::Ascii("erize"), dictgen::InsensitiveStr::Ascii("erized"), dictgen::InsensitiveStr::Ascii("erizes"), @@ -82121,6 +82122,7 @@ pub static WORD_PARAMT_CHILDREN: dictgen::DictTable<&'static [&'static str]> = d &["parameterises"], &["parameterising"], &["parametrization", "parameterization"], + &["parametrizations", "parameterizations"], &["parameterize"], &["parameterized"], &["parameterizes"], @@ -82130,7 +82132,7 @@ pub static WORD_PARAMT_CHILDREN: dictgen::DictTable<&'static [&'static str]> = d &["parameters"], &["parametrical"], ], - range: 2..=9, + range: 2..=10, }; static WORD_PARAMS_NODE: dictgen::DictTrieNode<&'static [&'static str]> = dictgen::DictTrieNode { @@ -82224,8 +82226,6 @@ pub static WORD_PARAME_CHILDREN: dictgen::DictTable<&'static [&'static str]> = d dictgen::InsensitiveStr::Ascii("tre"), dictgen::InsensitiveStr::Ascii("treless"), dictgen::InsensitiveStr::Ascii("tres"), - dictgen::InsensitiveStr::Ascii("trizations"), - dictgen::InsensitiveStr::Ascii("trized"), dictgen::InsensitiveStr::Ascii("tros"), dictgen::InsensitiveStr::Ascii("trs"), dictgen::InsensitiveStr::Ascii("tter"), @@ -82272,14 +82272,12 @@ pub static WORD_PARAME_CHILDREN: dictgen::DictTable<&'static [&'static str]> = d &["parameter"], &["parameterless"], &["parameters"], - &["parameterizations"], - &["parameterized"], &["parameters"], &["parameters"], &["parameter"], &["parameters"], ], - range: 1..=10, + range: 1..=8, }; static WORD_PARAMA_NODE: dictgen::DictTrieNode<&'static [&'static str]> = dictgen::DictTrieNode {