harper icon indicating copy to clipboard operation
harper copied to clipboard

feat: `SpellCheck` compounds with parts not in dictionary

Open hippietrail opened this issue 8 months ago • 0 comments

Issues

#115 and #823 are related but might not be fixed to the point of closing them. Fixes #1450 I'm pretty sure

Description

The SpellCheck linter no longer flags words that are not in the dictionary in their own right but are in the dictionary as part of two-word open or hyphenated compounds.

It handles the various cases of having the first part or the second part or both parts not in the dictionary individually, both for

It does not handle compounds of three or more words.

I bikeshedded and refactored the linter to some extent to help me understand it well enough to start working on it, clarifying ambiguous terms like "uppercase" (titlecase or all-caps or both?), abbreviating some words to make identifiers shorter so more logic fits on one line, etc.

We should be able to cull entries from the dictionary that are not really English words, such as hoc but are in the dictionary so that ad hoc doesn't get flagged.

How Has This Been Tested?

I added unit tests for various combinations by finding terms already in the dictionary that had one or both parts not also listed as individual entries.

All existing tests still pass. I have not tested interactions with different lettercase spellings very thoroughly.

Checklist

  • [x] I have performed a self-review of my own code
  • [x] I have added tests to cover my changes

hippietrail avatar Mar 06 '26 10:03 hippietrail