Skip to content

fix(core): add seven derived irregular verbs to the verb list - #4039

Open
mauropereiira wants to merge 3 commits into
Automattic:masterfrom
mauropereiira:fix/irregular-derived-verbs
Open

fix(core): add seven derived irregular verbs to the verb list#4039
mauropereiira wants to merge 3 commits into
Automattic:masterfrom
mauropereiira:fix/irregular-derived-verbs

Conversation

@mauropereiira

Copy link
Copy Markdown
Contributor

Issues

Follow-up to #4036 (which fixed #3916). No separate issue, this is the continuation I offered there.

Description

harper-core/irregular_verbs.json contains the base irregular verbs but is missing many of their common derived forms. IrregularVerbs is consumed by did_past.rs, will_non_lemma.rs, helped_past.rs, simple_past_to_past_participle.rs and regular_irregulars.rs, so a missing entry silently disables those rules for that verb.

Measured on master, using a verb that is present versus one that is not:

I will stood there.             ->  WillNonLemma     (stand IS in the file)
He helped stood there.          ->  HelpedPast
I did stood there.              ->  DidPast

I did rewrote it.               ->  no lint          (rewrite is NOT in the file)
He helped rewrote it.           ->  no lint

This adds seven entries:

["forsake", "forsook", "forsaken"],
["oversee", "oversaw", "overseen"],
["rebuild", "rebuilt", "rebuilt"],
["retake", "retook", "retaken"],
["rewrite", "rewrote", "rewritten"],
["withhold", "withheld", "withheld"],
["withstand", "withstood", "withstood"],

Why only seven

I originally had a list of nineteen, but most of them do nothing on their own.

The linters' expressions require the past form to be tagged as a verb before the lemma lookup is ever reached. Only these seven have preterite forms that the curated dictionary tags that way. I verified each one by building and testing rather than assuming:

forsook    PRETERITE                     ->  works
oversaw    PRETERITE                     ->  works
rebuilt    PRETERITE | PAST_PARTICIPLE   ->  works
retook     PRETERITE                     ->  works
rewrote    PRETERITE                     ->  works
withheld   PRETERITE | PAST_PARTICIPLE   ->  works
withstood  PRETERITE | PAST_PARTICIPLE   ->  works

withdrew, misunderstood, befell, foresaw, forgave, outgrew, overcame,
overheard, underwent, undertook, unwound, upheld   ->  no verb metadata

So withdraw, misunderstand, befall, foresee, forgive, outgrow, overcome, overhear, undergo, undertake, unwind and uphold are still missing from the list, but adding them here would change nothing. They need dictionary metadata first, which looked like a separate curation change rather than something to smuggle into this PR. Happy to take that on if you want it, just wanted to check the direction first.

I also deliberately excluded invariant-form verbs such as beset, offset and upset, where all three forms are identical.

Demo

Not applicable, CLI output below.

How Has This Been Tested?

cargo test -p harper-core — 6126 + 42 tests pass, 0 failures, no snapshot changes.

Manually with cargo run --bin harper-cli --release -- lint, comparing a build of master against this branch.

Now flagged, previously silent:

I did withstood it.    ->  DidPast        I did oversaw it.    ->  DidPast
I did rewrote it.      ->  DidPast        I did withheld it.   ->  DidPast
I did rebuilt it.      ->  DidPast        I did forsook it.    ->  DidPast
I did retook it.       ->  DidPast        He helped rewrote it. -> HelpedPast

Still clean:

I did withstand it.
The bridge withstood the storm.
I rewrote the introduction.

AI Disclosure

  • I am an agent or I got an agent to do the work autonomously.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have considered splitting this into smaller pull requests.

Two tests were added rather than one per verb, since they all exercise the same lookup path and the maintainers have asked contributors to trim unnecessary tests.

Mauro Pereira and others added 2 commits August 13, 2026 17:27
Follow-up to Automattic#4036, which added "understand" and fixed Automattic#3916.

`harper-core/irregular_verbs.json` carries the base verbs but is missing many
of their derived forms, so `DidPast` and `HelpedPast` silently do nothing for
those verbs. Adds forsake, oversee, rebuild, retake, rewrite, withhold and
withstand.

Only these seven were added. The curated dictionary tags their preterite forms
as verbs, which is what the linters' expressions require before the lemma
lookup ever happens. Another twelve derived verbs are also absent from the
list, but their past forms carry no verb metadata in the dictionary, so adding
them here alone would have no effect.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
harper-asciidoc@2.8.0
harper-brill@2.8.0
harper-comments@2.8.0
harper-core@2.8.0
harper-dictionary-wordlist@2.8.0
harper-git-commit@2.8.0
harper-html@2.8.0
harper-ink@2.8.0
harper-jjdescription@2.8.0
harper-literate-haskell@2.8.0
harper-ls@2.8.0
harper-pos-utils@2.8.0
harper-python@2.8.0
harper-stats@2.8.0
harper-tex@2.8.0
harper-thesaurus@2.8.0
harper-tree-sitter@2.8.0
harper-typst@2.8.0

Generated by cargo-workspaces
@hippietrail

Copy link
Copy Markdown
Collaborator

When working on the irregular verbs (or irregular plurals) it's a good idea to try to match your changes in both dictionary.dict and irregular_nouns.json/irregular_nouns.json - if it's not clear how to annotate the main verb entries of the entries for the inflections then feel free to ask here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False negative: the linter for "did went" doesn't flag "didn't understood"

3 participants