Automattic / Automattic/harper

Dictionary: the auxiliary verb flag `A` is applied inconsistently

Open
#4,086 2 comments 1 reaction 0 assignees View on GitHub
bug dictionary
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

## What

The `A` auxiliary-verb annotation flag in `harper-core/dictionary.dict` is applied inconsistently. 40 entries carry it, but coverage within a single verb's own paradigm is uneven, and at least one entry has it that clearly should not.

Found while discussing Automattic/harper#4035, where `.is_auxiliary_verb()` looked like a natural predicate for `has`/`had` and turned out not to work. @hippietrail confirmed this deserves its own bug.

## Inflected forms of `be`, `have` and `do`

Only the lemma is flagged in two of the three paradigms:

```
be A have A do A
am missing has missing does A
is missing had missing did A
are missing having missing doing missing
was missing done missing
were missing
being missing
been missing
```

`is` and `was` are the copula and the progressive/passive auxiliary, and neither is flagged, while `be` is.

## Negative contractions

Split roughly down the middle, and inconsistently within a paradigm:

```
has A missing
------------------------------------ ------------------
isn't haven't doesn't don't aren't wasn't
didn't can't couldn't won't weren't hasn't
wouldn't shouldn't mustn't hadn't
```

`isn't` is flagged but `aren't`, `wasn't` and `weren't` are not. `haven't` is flagged but `hasn't` and `hadn't` are not.

## Modals

These are the one clean group. All nine carry the flag:

```
can could may might must shall should will would
```

## Entries that probably should not have it

```
trojan/NgSVAdG
```

`trojan` is not an auxiliary verb under any definition. It came in with #2202. `best/~JuNSgVGdA` and `better/~JcNgSVdGAL` also carry it; `better` is at least arguable through the "had better" semi-modal construction, but `best` looks doubtful and both are worth a second opinion rather than a blind removal.

## Why it matters

Any linter reaching for `TokenKind::is_auxiliary_verb()` silently gets a partial set, and the gaps do not follow an obvious rule, so the failure is quiet rather than loud. In #4035 that meant the predicate missed exactly the two words the rule needed.

## Note on scope

@hippietrail raised the real complication: "auxiliary verb" is a fuzzy term and sources disagree on the boundaries, particularly for semi-modals (`dare`, `need`, `ought`, `had better`) and for `doing`/`done`/`being`/`been`. So the missing-flag list above is not a patch to apply as-is. The prior question is what definition Harper wants, and the answer determines which of these entries are genuinely wrong.

Happy to do the dictionary pass once there is agreement on the boundary. Filing the audit now so the data is recorded.

## Modal + `'ve` forms

Added after @hippietrail pointed at the contractions. This is the most inconsistent group found so far, five entries in one paradigm with four different flag combinations:

```
could've/V
might've/V
must've/
should've/VA
would've/
```

Only `should've` is marked auxiliary. Two carry a bare verb flag and two carry nothing at all.

## Contractions: already covered

For the record, so nobody re-audits them: every negative modal contraction present in the dictionary already carries `A` (`can't`, `couldn't`, `mightn't`, `mayn't`, `mustn't`, `shan't`, `shouldn't`, `won't`, `wouldn't`, `oughtn't`, `needn't`). `daren't` is absent from the dictionary entirely.

Of the `n't've` double contractions, only `couldn't've/VA†` exists, and it carries the flag. `mightn't've`, `shouldn't've`, `wouldn't've`, `mustn't've`, `oughtn't've`, `shan't've` and `needn't've` are absent, so that is a missing-entry question rather than a missing-annotation one.

Contributor guide

Open the contributing guide

Research direction

Start with harper-core/dictionary.dict and the TokenKind::is_auxiliary_verb() path implicated by #4035. First establish Harper’s intended boundary for auxiliaries, including semi-modals and inflected and contraction forms; done means the agreed definition is reflected consistently in the dictionary and the predicate no longer misses the forms its rules require.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.