Automattic / Automattic/harper

Let's have a "wrong preposition" tool in `harper-cli` and/or in the `justfile`

Open
#3,337 1 comment 0 reactions 1 assignee Claimed by @quick123-666 View on GitHub
enhancement good first issue harper-cli justfile linting prepositions
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

A common class of grammatical errors (in all languages actually) is using the correct preposition.

Sometimes there's no edge cases and we can use a Weir rule or `phrase_set_correction`.
But often that's too naïve and there are lots of false positives. So it's best to hunt for them before deciding how to write a new rule, or decide if it's even possible.

I usually use Google Search with quotes and `OR` operators but there's a better way.

`prep-pattern` (or dozens of other probably better names)

`harper-cli prep pattern install,installed,installing,installs P` (or some other format)

This could invoke `harper-cli lint --only` with a `Linter` it makes on-the-fly, probably an `ExprLinter`

On second thought, it wouldn't need a `Linter`, just an `Expr` on a `Document`.

If you have a corpus of files to test Harper on like I do (mine are README files from GitHub trending projects updated daily) you can pass in that directory and observe the output to see:

- All hits look like errors
- Repeated patterns of false positives
- Only some inflections lead to false positives
- etc.

----
Examples I was recently researching manually without such a tool:
- saddled to / saddled with
- inspired from / inspired by
- install in / install into / install on

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.