Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix: don't flag "can not" to join as a "compound noun" (#1287)
Andrew Dunbar6b5d18adba94
diff --git a/harper-core/src/linting/compound_nouns/implied_instantiated_compound_nouns.rs b/harper-core/src/linting/compound_nouns/implied_instantiated_compound_nouns.rsindex af6cb4acc..79ed7085d 100644--- a/harper-core/src/linting/compound_nouns/implied_instantiated_compound_nouns.rs+++ b/harper-core/src/linting/compound_nouns/implied_instantiated_compound_nouns.rs@@ -17,7 +17,7 @@ pub struct ImpliedInstantiatedCompoundNouns {impl Default for ImpliedInstantiatedCompoundNouns {fn default() -> Self {let split_pattern = Lrc::new(SplitCompoundWord::new(|meta| {- meta.is_noun() && !meta.is_proper_noun()+ meta.is_noun() && !meta.is_proper_noun() && !meta.is_verb()}));let pattern = SequencePattern::default().then(split_pattern.clone())diff --git a/harper-core/src/linting/compound_nouns/mod.rs b/harper-core/src/linting/compound_nouns/mod.rsindex 466cb608c..fc945f809 100644--- a/harper-core/src/linting/compound_nouns/mod.rs+++ b/harper-core/src/linting/compound_nouns/mod.rs@@ -302,4 +302,9 @@ mod tests {0,);}++ #[test]+ fn allow_can_not() {+ assert_lint_count("Size can not be determined.", CompoundNouns::default(), 0);+ }}