Skip to content

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

fix: dict entries for forms of `strike` and `strive` (#4816)

Andrew Dunbar32ad64208a65
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index 67123e7e9..32c85447e 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -47612,7 +47612,7 @@ stria/N0g
striae/N9
striated/JV
striation/NgS
-stricken/~JV
+stricken/~JVT
strict/~J>Y^p
strictness/Nmg
stricture/NSg
@@ -47647,8 +47647,8 @@ stripping/~V6Ng
striptease/NgSVGd>Z
stripteaser/Ng
stripy/J
-strive/~VGSN
-striven/V
+strive/~VGSd
+striven/VT
strobe/~NgSV
stroboscope/NgS
stroboscopic/J
@@ -47670,8 +47670,8 @@ stropped/VtT
stroppily/Ry
stropping/V6N
stroppy/J^>p
-strove/~V
-struck/~V
+strove/~Vt
+struck/~VtT
struct/NgS
structural/~JYN
structuralism/N
diff --git a/harper-core/src/linting/simple_past_to_past_participle.rs b/harper-core/src/linting/simple_past_to_past_participle.rs
index e742d4627..aa807bb76 100644
--- a/harper-core/src/linting/simple_past_to_past_participle.rs
+++ b/harper-core/src/linting/simple_past_to_past_participle.rs
@@ -1,9 +1,8 @@
-use crate::linting::expr_linter::Chunk;
use crate::{
- Token,
+ Token, TokenKind,
expr::{All, Expr, FirstMatchOf, SequenceExpr},
irregular_verbs::IrregularVerbs,
- linting::{ExprLinter, Lint, LintKind, Suggestion},
+ linting::{ExprLinter, Lint, LintKind, Suggestion, expr_linter::Chunk},
patterns::{InflectionOfBe, WordSet},
};
@@ -35,7 +34,10 @@ impl Default for SimplePastToPastParticiple {
])),
])
.t_ws()
- .then_verb_simple_past_form(),
+ .then_kind_is_but_is_not(
+ TokenKind::is_verb_simple_past_form,
+ TokenKind::is_verb_past_participle_form,
+ ),
),
// negative: exceptions
Box::new(SequenceExpr::unless(FirstMatchOf::new(vec![
@@ -527,4 +529,17 @@ mod tests {
fn dont_flag_has_lost() {
assert_no_lints("He has lost his keys.", test_linter());
}
+
+ #[test]
+ fn alice() {
+ assert_no_lints("it had struck her foot!", test_linter());
+ }
+
+ #[test]
+ fn gatsby() {
+ assert_no_lints(
+ "the tuning-fork that had been struck upon a star",
+ test_linter(),
+ );
+ }
}
diff --git a/harper-core/tests/text/tagged/Alice's Adventures in Wonderland.md b/harper-core/tests/text/tagged/Alice's Adventures in Wonderland.md
index 14b8a8b39..cdd5bd58b 100644
--- a/harper-core/tests/text/tagged/Alice's Adventures in Wonderland.md
+++ b/harper-core/tests/text/tagged/Alice's Adventures in Wonderland.md
@@ -413,7 +413,7 @@
>
#
> Just then her head struck against the roof of the hall : in fact she was now more
-# J/R NSg/J/R/C ISg/D$+ NPr/VB/J+ VB C/P D NSg/VB P D+ NPr+ . NPr/J/R/P NSg+ ISg+ VLPt NSg/J/R/C NPr/I/J/R/Dq
+# J/R NSg/J/R/C ISg/D$+ NPr/VB/J+ VP C/P D NSg/VB P D+ NPr+ . NPr/J/R/P NSg+ ISg+ VLPt NSg/J/R/C NPr/I/J/R/Dq
> than nine feet high , and she at once took up the little golden key and hurried
# C/P NSg+ NPl+ NSg/VB/J/R . VB/C ISg+ NSg/P NSg/C VPt NSg/VB/J/P D NPr/I/J/Dq NPr/VB/J NPr/VB/J VB/C VP/J
> off to the garden door .
@@ -1911,7 +1911,7 @@
> right - hand bit to try the effect : the next moment she felt a violent blow
# NPr/VB/J . NSg/VB+ NSg/VPt+ P NSg/VB/J D NSg/VB+ . D NSg/J/P NSg+ ISg+ N🅪Sg/VP/J D/P NSg/VB/J NSg/VB/J+
> underneath her chin : it had struck her foot !
-# NSg/J/P ISg/D$+ NPr/VB+ . NSg/ISg+ VP VB ISg/D$+ NSg/VB+ .
+# NSg/J/P ISg/D$+ NPr/VB+ . NSg/ISg+ VP VP ISg/D$+ NSg/VB+ .
>
#
> She was a good deal frightened by this very sudden change , but she felt that
diff --git a/harper-core/tests/text/tagged/The Great Gatsby.md b/harper-core/tests/text/tagged/The Great Gatsby.md
index 52ea037ca..aad7b943e 100644
--- a/harper-core/tests/text/tagged/The Great Gatsby.md
+++ b/harper-core/tests/text/tagged/The Great Gatsby.md
@@ -2463,7 +2463,7 @@
> know — though here and there was a face I had noticed on the commuting train . I
# VB . C R VB/C R+ VLPt D/P NSg/VB+ ISg/#r+ VP VP/J J/P D Nᴹ/Vg/J NSg/VB+ . ISg/#r+
> was immediately struck by the number of young Englishmen dotted about ; all well
-# VLPt R VB P D N🅪Sg/VB/JC+ P NPr/VB/J NPl VP/J J/P . NSg/I/J/C/Dq NSg/VB/J/R
+# VLPt R VP P D N🅪Sg/VB/JC+ P NPr/VB/J NPl VP/J J/P . NSg/I/J/C/Dq NSg/VB/J/R
> dressed , all looking a little hungry , and all talking in low , earnest voices to
# VP/J . NSg/I/J/C/Dq Nᴹ/Vg/J D/P NPr/I/J/Dq J . VB/C NSg/I/J/C/Dq Nᴹ/Vg/J+ NPr/J/R/P NSg/VB/J/R . NPr/VB/J+ NPl/V3+ P
> solid and prosperous Americans . I was sure that they were selling something :
@@ -6961,7 +6961,7 @@
> her perishable breath , his mind would never romp again like the mind of God . So
# ISg/D$+ NSg/J N🅪Sg/VB/J+ . ISg/D$+ NSg/VB+ VXB R NSg/VB R NSg/VB/J/C/P D NSg/VB P NPr/VB+ . NSg/I/J/R/C
> he waited , listening for a moment longer to the tuning - fork that had been struck
-# NPr/ISg+ VP/J . Nᴹ/Vg/J R/C/P D/P+ NSg+ NSg/JC P D+ Nᴹ/Vg/J+ . NSg/VB+ I/C/Ddem+ VP VLPp/B VB
+# NPr/ISg+ VP/J . Nᴹ/Vg/J R/C/P D/P+ NSg+ NSg/JC P D+ Nᴹ/Vg/J+ . NSg/VB+ I/C/Ddem+ VP VLPp/B VP
> upon a star . Then he kissed her . At his lips ’ touch she blossomed for him like a
# P D/P+ NSg/VB+ . NSg/J/R/C NPr/ISg+ VP/J ISg/D$+ . NSg/P ISg/D$+ NPl/V3+ . N🅪Sg/VB ISg+ VP/J R/C/P ISg+ NSg/VB/J/C/P D/P
> flower and the incarnation was complete .