More irregular verbs for 'have went' linter (#1973)

* fix: `SimplePastToPastParticiple` irregular verbs++

Also convert to the new verb metadata

* fix: remove commented-out line

* fix: remove no-longer needed code

---------

Co-authored-by: Elijah Potter <me@elijahpotter.dev>
This commit is contained in:
Andrew Dunbar 2025-10-07 04:08:17 +08:00 committed by GitHub
parent d03d487921
commit c604c67a12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 7 deletions

View file

@ -52467,7 +52467,7 @@ wrongful/~JYp
wrongfulness/Nmg
wrongheaded/JYp
wrongheadedness/Ng
wrongness/Nmg
wrongness/Ng
wrote/~Vtr
wroth/J
wrought/~JV

View file

@ -427,6 +427,8 @@ impl SequenceExpr {
gen_then_from_is!(auxiliary_verb);
gen_then_from_is!(linking_verb);
gen_then_from_is!(verb_lemma);
gen_then_from_is!(verb_simple_past_form);
gen_then_from_is!(verb_past_participle_form);
// Adjectives

View file

@ -8,28 +8,50 @@ use crate::{
/// Maps common irregular verbs between their simple past and past participle forms.
const IRREGULAR_VERBS: &[(&str, &str)] = &[
("arose", "arisen"),
("ate", "eaten"),
("awoke", "awoken"),
("bade", "bidden"),
("became", "become"),
("began", "begun"),
("bit", "bitten"),
("blew", "blown"),
("broke", "broken"),
("came", "come"),
("chose", "chosen"),
("did", "done"),
("drank", "drunk"),
("drove", "driven"),
("fell", "fallen"),
("flew", "flown"),
("forgot", "forgotten"),
("forwent", "forgone"),
("gave", "given"),
("knew", "known"),
("mistook", "mistaken"),
("overtook", "overtaken"),
("partook", "partaken"),
// proved, proved/proven
("ran", "run"),
("rang", "rung"),
("rode", "ridden"),
("rose", "risen"),
("sang", "sung"),
("sank", "sunken"),
("saw", "seen"),
("sewed", "sewn"),
("slew", "slain"),
("spoke", "spoken"),
("stank", "stunk"),
("stole", "stolen"),
("swam", "swum"),
("trod", "trodden"),
("took", "taken"),
// was, been
// were, been
("went", "gone"),
("woke", "woken"),
("wove", "woven"),
("wrote", "written"),
];
@ -40,11 +62,6 @@ pub struct SimplePastToPastParticiple {
impl Default for SimplePastToPastParticiple {
fn default() -> Self {
let mut simple_past_forms_word_set = WordSet::default();
for (simple_past, _) in IRREGULAR_VERBS {
simple_past_forms_word_set.add(simple_past);
}
Self {
expr: Box::new(All::new(vec![
// positive: the general case
@ -57,7 +74,7 @@ impl Default for SimplePastToPastParticiple {
Box::new(InflectionOfBe::default()),
])
.t_ws()
.then(simple_past_forms_word_set),
.then_verb_simple_past_form(),
),
// negative: one known exception
Box::new(

View file

@ -94,6 +94,7 @@ impl TokenKind {
is_linking_verb,
is_verb_lemma,
is_verb_simple_past_form,
is_verb_past_participle_form,
is_verb_progressive_form,
is_verb_third_person_singular_present_form,