Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
chore: false positives, dict tweak
hippietraildf2b0970821b
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dictindex 96e3cb9c4..6f4d99423 100644--- a/harper-core/dictionary.dict+++ b/harper-core/dictionary.dict@@ -40277,7 +40277,7 @@ rickrack/1Mrickshaw/14MSricochet/14GMDSricotta/1M-rid/~54S+rid/~4S # removed adj flag, too archaicriddance/1Mridden/~45ridding/4diff --git a/harper-core/src/linting/adjective_of_a.rs b/harper-core/src/linting/adjective_of_a.rsindex e1b025e89..0fd29e276 100644--- a/harper-core/src/linting/adjective_of_a.rs+++ b/harper-core/src/linting/adjective_of_a.rs@@ -8,12 +8,14 @@ pub struct AdjectiveOfA;const FALSE_POSITIVES: &[&str] = &[// Different valid constructions."all",+ "emblematic","full","inside","much","out",// The word is used more as a noun in this context.// (using .kind.is_likely_homograph() here is too strict)+ "back","bottom","chance","front",@@ -25,9 +27,12 @@ const FALSE_POSITIVES: &[&str] = &["one","part","potential",+ "precision",+ // for "rid" I removed the `5` flag in `dictionary.dict``"shadow","short","something",+ "sound",];fn is_false_positive(chars: &[char]) -> bool {@@ -334,4 +339,55 @@ mod tests {0,);}++ #[test]+ fn dont_flag_sound() {+ // Can be an adjective in e.g. "sound advice"+ assert_lint_count(+ "the sound of an approaching Krampus",+ AdjectiveOfA,+ 0,+ );+ }++ #[test]+ fn dont_flag_rid() {+ // I removed the `5` flag from `rid` in `dictionary.dict`+ // because dictionaries say the sense is archaic.+ assert_lint_count(+ "I need to get rid of a problem",+ AdjectiveOfA,+ 0,+ );+ }++ #[test]+ fn dont_flag_precision() {+ // Can be an adjective in e.g. "a precision instrument"+ assert_lint_count(+ "a man whose crew cut has the precision of a targeted drone strike",+ AdjectiveOfA,+ 0,+ );+ }++ #[test]+ fn dont_flag_back() {+ // Can be an adjective in e.g. "back door"+ assert_lint_count(+ "a man whose crew cut has the back of a targeted drone strike",+ AdjectiveOfA,+ 0,+ );+ }++ #[test]+ fn dont_flag_emblematic() {+ // "emblematic of" is correct idiomatic usage+ assert_lint_count(+ "... situation was emblematic of a publication that ...",+ AdjectiveOfA,+ 0,+ );+ }}