Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix: flag "piece of advise" (#2266)
Andrew Dunbar2910319fb542
diff --git a/harper-core/src/linting/noun_verb_confusion/mod.rs b/harper-core/src/linting/noun_verb_confusion/mod.rsindex a2e3b3eb7..8685d0ad8 100644--- a/harper-core/src/linting/noun_verb_confusion/mod.rs+++ b/harper-core/src/linting/noun_verb_confusion/mod.rs@@ -1361,4 +1361,13 @@ mod tests {NounVerbConfusion::default(),);}++ #[test]+ fn issue_2041() {+ assert_suggestion_result(+ "Let me give you a piece of advise.",+ NounVerbConfusion::default(),+ "Let me give you a piece of advice.",+ );+ }}diff --git a/harper-core/src/linting/noun_verb_confusion/verb_instead_of_noun.rs b/harper-core/src/linting/noun_verb_confusion/verb_instead_of_noun.rsindex 5cc9e20ca..ae067369f 100644--- a/harper-core/src/linting/noun_verb_confusion/verb_instead_of_noun.rs+++ b/harper-core/src/linting/noun_verb_confusion/verb_instead_of_noun.rs@@ -24,7 +24,7 @@ impl Default for VerbInsteadOfNoun {Self {expr: Box::new(SequenceExpr::default()- .then(UPOSSet::new(&[UPOS::ADJ]))+ .then(UPOSSet::new(&[UPOS::ADJ, UPOS::ADP])).then_whitespace().then(verbs.clone()),),