Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

test: more en-AU & en-CA vs en-BR & en-US

hippietrail19e64c57c4fe
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index 8b2a683ee..ac5c3c0b8 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -5653,6 +5653,8 @@ LVN/1
La/21SM
Lab/12
Laban/2M
+Labor/2M_ # the australian political party doesn't use the normal australian spelling of 'labour'
+Labour/2M! # the uk political party does use the normal british spelling of 'labour'
Labrador/21SM
Labradorean/51
Lacey/2M
@@ -50189,7 +50191,8 @@ venturousness/1M
venue/~1ASM
veracious/5Y
veracity/~1M
-veranda/1SM
+veranda/1SM!@<
+verandah/1SM_
verapamil/1
verb/~14KMS
verbal/~514MYS
diff --git a/harper-core/src/linting/spell_check.rs b/harper-core/src/linting/spell_check.rs
index 046af1acd..6e649e91c 100644
--- a/harper-core/src/linting/spell_check.rs
+++ b/harper-core/src/linting/spell_check.rs
@@ -225,4 +225,49 @@ mod tests {
1,
);
}
+
+ #[test]
+ fn mixing_australian_and_canadian_dialects() {
+ assert_lint_count(
+ "In summer we sit on the verandah and eat yogourt.",
+ SpellCheck::new(FstDictionary::curated(), Dialect::Australian),
+ 1,
+ );
+ }
+
+ #[test]
+ fn mixing_canadian_and_australian_dialects() {
+ assert_lint_count(
+ "In summer we sit on the verandah and eat yogourt.",
+ SpellCheck::new(FstDictionary::curated(), Dialect::Canadian),
+ 1,
+ );
+ }
+
+ #[test]
+ fn australian_and_canadian_spellings_that_are_not_american() {
+ assert_lint_count(
+ "In summer we sit on the verandah and eat yogourt.",
+ SpellCheck::new(FstDictionary::curated(), Dialect::American),
+ 2,
+ );
+ }
+
+ #[test]
+ fn australian_and_canadian_spellings_that_are_not_british() {
+ assert_lint_count(
+ "In summer we sit on the verandah and eat yogourt.",
+ SpellCheck::new(FstDictionary::curated(), Dialect::British),
+ 2,
+ );
+ }
+
+ // #[test]
+ // fn australian_labour_vs_labor() {
+ // assert_lint_count(
+ // "In Australia we write 'labour' but the political party is the 'Labor Party'.",
+ // SpellCheck::new(FstDictionary::curated(), Dialect::Australian),
+ // 0,
+ // )
+ // }
}