Skip to content

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

fix(core): PiqueInterest now works with possessive determiners (#1708)

Elijah Potter0297ce4d6b17
diff --git a/harper-core/src/linting/pique_interest.rs b/harper-core/src/linting/pique_interest.rs
index 213721a66..9aea4107a 100644
--- a/harper-core/src/linting/pique_interest.rs
+++ b/harper-core/src/linting/pique_interest.rs
@@ -15,7 +15,9 @@ impl Default for PiqueInterest {
"peak", "peaked", "peek", "peeked", "peeking", "peaking",
]))
.then_whitespace()
- .then_non_plural_nominal()
+ .then(|tok: &Token, _: &[char]| {
+ tok.kind.is_non_plural_nominal() || tok.kind.is_possessive_determiner()
+ })
.then_whitespace()
.t_aco("interest");
@@ -128,4 +130,13 @@ mod tests {
"She was piquing his interest with her stories.",
);
}
+
+ #[test]
+ fn corrects_peaked_my_interest() {
+ assert_suggestion_result(
+ "you've peaked my interest.",
+ PiqueInterest::default(),
+ "you've piqued my interest.",
+ );
+ }
}