mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
fix(spell): accept -ize verbs the dictionary lists only as -ization/-ized (#3951)
parallelize, modularize, virtualize and similar verbs were flagged as typos while parallelization/parallelized passed. Add the missing base forms (US and UK spelling) to the extra dictionary.
This commit is contained in:
@@ -1328,3 +1328,30 @@ yodel/SM
|
||||
yodelled
|
||||
yodeller/MS
|
||||
yodelling
|
||||
annualize/GDS
|
||||
annualise/GDS
|
||||
decimalize/GDS
|
||||
decimalise/GDS
|
||||
decriminalize/GDS
|
||||
decriminalise/GDS
|
||||
demonetize/GDS
|
||||
demonetise/GDS
|
||||
denationalize/GDS
|
||||
denationalise/GDS
|
||||
depressurize/GDS
|
||||
depressurise/GDS
|
||||
disorganize/GDS
|
||||
disorganise/GDS
|
||||
modularize/GDS
|
||||
modularise/GDS
|
||||
parallelize/GDS
|
||||
parallelise/GDS
|
||||
recapitalize/GDS
|
||||
recapitalise/GDS
|
||||
ritualize/GDS
|
||||
ritualise/GDS
|
||||
underutilize/GDS
|
||||
underutilise/GDS
|
||||
virtualize/GDS
|
||||
virtualise/GDS
|
||||
reauthorize/GDS
|
||||
|
||||
@@ -101,7 +101,8 @@ impl SpellScope {
|
||||
/// At most this many typos are reported per text.
|
||||
pub const MAX_TYPOS: usize = 2000;
|
||||
|
||||
/// The en_GB entries en_US lacks (`colour`, `behaviour`, `normalise`), in the
|
||||
/// The en_GB entries en_US lacks (`colour`, `behaviour`, `normalise`) and the
|
||||
/// -ize verbs it lists only as `-ization` / `-ized` (`parallelize`), in the
|
||||
/// same affix scheme: either spelling passes.
|
||||
const EN_GB_EXTRA: &str = include_str!("dict/en_GB-extra.dic");
|
||||
|
||||
@@ -548,6 +549,27 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ize_verbs_whose_derivatives_are_listed() {
|
||||
let s = Speller::default();
|
||||
for ok in [
|
||||
"parallelize",
|
||||
"parallelise",
|
||||
"parallelizes",
|
||||
"parallelizing",
|
||||
"modularize",
|
||||
"virtualize",
|
||||
"virtualised",
|
||||
"decimalize",
|
||||
"underutilize",
|
||||
] {
|
||||
assert!(s.is_correct(ok), "{ok}");
|
||||
}
|
||||
for bad in ["desireable", "releative", "parallelizee"] {
|
||||
assert!(!s.is_correct(bad), "{bad}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn british_spellings() {
|
||||
let s = Speller::default();
|
||||
|
||||
Reference in New Issue
Block a user