Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix(core): restrict `GeneralCompoundNouns` to ignore adverb prefixes
Elijah Potter449552939bd4
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dictindex d4aead245..e6bbddd23 100644--- a/harper-core/dictionary.dict+++ b/harper-core/dictionary.dict@@ -12252,7 +12252,7 @@ anvil/14MSanxiety/1SManxious/5YPanxiousness/1M-any/8~+any/8~j5anybody/8SManyhow/5anymore/diff --git a/harper-core/src/linting/compound_nouns/general_compound_nouns.rs b/harper-core/src/linting/compound_nouns/general_compound_nouns.rsindex f1c795d5a..5c2434c01 100644--- a/harper-core/src/linting/compound_nouns/general_compound_nouns.rs+++ b/harper-core/src/linting/compound_nouns/general_compound_nouns.rs@@ -25,7 +25,7 @@ impl Default for GeneralCompoundNouns {return false;};- tok.span.len() > 1 && !meta.article && !meta.preposition+ tok.span.len() > 1 && !meta.article && !meta.preposition && !meta.is_adverb()}).then_whitespace().then(|tok: &Token, _: &[char]| {diff --git a/harper-core/src/linting/compound_nouns/mod.rs b/harper-core/src/linting/compound_nouns/mod.rsindex 7f5d95410..68b0ba376 100644--- a/harper-core/src/linting/compound_nouns/mod.rs+++ b/harper-core/src/linting/compound_nouns/mod.rs@@ -264,4 +264,13 @@ mod tests {0,);}++ #[test]+ fn allows_issue_721() {+ assert_lint_count(+ "So if you adjust any one of these adjusters that can have a negative or a positive effect.",+ CompoundNouns::default(),+ 0,+ );+ }}