Commit graph

12 commits

Author SHA1 Message Date
Elijah Potter
d323c39b50
feat(core): create rule to detect incorrect verbs in nominal phrase (#2176) 2025-11-13 15:32:54 -07:00
Andrew Dunbar
15497e5960
feat: add the 3 main types of adverb (#2158)
Resloves #1777

Co-authored-by: Elijah Potter <me@elijahpotter.dev>
2025-11-13 19:07:19 +00:00
Andrew Dunbar
19832424d6
feat: harper-cli audit-dictionary (#2136)
* feat: `harper-cli audit-dictionary`

* feat: `just auditdictionary` and `just auditdict` alias

* fix: end file with linefeed

* feat: add dictionary audit to `check-rust` recipe

Also:
- improve audit counts and warnings
- Add the `♂`, `♀`, and `ª` flags to `annotations.json` with comments that they're not implemented yet
2025-11-11 21:39:41 +00:00
Andrew Dunbar
d249169414
chore: normalize flags, +noun & verb flags (#1891)
* chore: normalize flags, +noun & verb flags

* feat: curate annotation flags

* chore: missing words from snapshots

- Noun and verb curation
- Added adjective POS property for the -able/-ible suffix

* fix: linters broke with "not" set to adverb

* fix(ci): update snapshots

---------

Co-authored-by: Elijah Potter <me@elijahpotter.dev>
2025-09-12 18:09:22 +00:00
Elijah Potter
936073ff3b
feat(core): create initial ToTwoToo rule (#1712) 2025-09-09 14:15:46 -06:00
Andrew Dunbar
6396f9baa7
chore: various improvements to phrasal verb linter (#1824)
* chore: various improvements to phrasal verb linter

- a compound noun at the start of a chunk followed by a preposition will no longer be flagged
- a compound noun followed by "that" or "which" will no longer be flagged
- exceptions added for "markup" and "plugin" as parts of compounds
- `annotations.json` now marks `-ing` forms of verbs as mass nouns and adjectives
- several dictionary entries needed to be tweaked

A couple of quite subtle false positives are now flagged in the snapshots

* chore: fix "king" and "whispering" dictionary entries
2025-09-04 15:22:07 +00:00
Andrew Dunbar
ac5ff976bb
Implement full verb form annotations (#1730)
* feat: annotations for verb form properties

* feat: annotations for verb form properties

* feat: verb form ("tense") properties fully propagated

It turns out that the expectatiion that all past participles and present participles can function as adjectives is not true after all: "cared" for instance. This has affected a couple of current tests.

The best fix is unclear. Perhaps separate annotations flags for verbs where the assumptions is true versus false. Perhaps defaulting to true and needing to create the individual form entries separately so they don't get the adjective annotation. It seems this strongly correlates with whether verbs are transitive or intransitive, which we don't yet track. So maybe we should handle both together.

- just "past" for regular verbs
- separate "preterite"/"simple past" and "past participle" for irregular verbs

Also:
- POS tag snapshots now annotate all verb forms
- adjective positive degree marked
- improved error messages for JSON file parse failures
- simplified everyday.rs to use these changes
- new rust lifetime lint annotations

* fix: address the concerns in the code review
2025-09-03 18:34:49 +00:00
Andrew Dunbar
a2bc3743a0
fix: align comment field in printannotations (#1617)
Some checks are pending
Build Chrome Plugin / package (push) Waiting to run
Build Binaries / Release harper-cli - macOS-aarch64 (push) Waiting to run
Build Binaries / Release harper-cli - Linux-aarch64-GNU (push) Waiting to run
Build Binaries / Release harper-cli - Linux-aarch64-musl (push) Waiting to run
Build Binaries / Release harper-cli - macOS-x86_64 (push) Waiting to run
Build Binaries / Release harper-cli - Linux-x86_64-GNU (push) Waiting to run
Build Binaries / Release harper-cli - Linux-x86_64-musl (push) Waiting to run
Build Binaries / Release harper-cli - Windows-x86_64 (push) Waiting to run
Build Binaries / Release harper-ls - macOS-aarch64 (push) Waiting to run
Build Binaries / Release harper-ls - Linux-aarch64-GNU (push) Waiting to run
Build Binaries / Release harper-ls - Linux-aarch64-musl (push) Waiting to run
Build Binaries / Release harper-ls - macOS-x86_64 (push) Waiting to run
Build Binaries / Release harper-ls - Linux-x86_64-GNU (push) Waiting to run
Build Binaries / Release harper-ls - Linux-x86_64-musl (push) Waiting to run
Build Binaries / Release harper-ls - Windows-x86_64 (push) Waiting to run
Build Web / build (push) Waiting to run
Package VS Code Plugin / Package - darwin-arm64 (push) Waiting to run
Package VS Code Plugin / Package - darwin-x64 (push) Waiting to run
Package VS Code Plugin / Package - linux-arm64 (push) Waiting to run
Package VS Code Plugin / Package - linux-x64 (push) Waiting to run
Package VS Code Plugin / Package - win32-x64 (push) Waiting to run
Package WordPress Plugin / package (push) Waiting to run
Precommit / precommit (push) Waiting to run
Also adds several aliases and corrects two comments in `annotations.json`
2025-07-23 19:16:35 +00:00
Andrew Dunbar
ca8ec6cc23
feat: detect "more faster", "most best" (#1507)
* feat: detect "more faster", "most best"

work in progress

* fix: `just format`

* refactor: complete basic featureset

Superlative annotation flag changed from `T` to `^` to match the comparative `>`. Mnemonic comment fields added..

* chore: mark comparatives and superlatives in dictionary

These are the ones whose last letter is doubled since the affix logic doesn't handle that.

Add comments to `affixes.json` linking the annotation flags for the base form comparative and superlative with the deirved term ones.

Add `get_degree` to `WordMetadata` and as a bonus also `get_person` for pronouns.

* Positive degree is not yet queryable as I suspect there could be false positives.

* fix: warning
2025-07-18 18:12:37 +00:00
Andrew Dunbar
b310575754
feat: support quantifier as type of determiner (#1564)
* feat: support quantifier as type of determiner

* chore:  make `is_quantifier` a preferred alias for `is_quantifier_determiner`
2025-07-15 14:29:56 +00:00
Andrew Dunbar
ffc88736cf
feat: just printaffixes prints letters free for new flags (#1540)
* feat: `just printaffixes` prints letters free for new flags

I've also renamed it to `just annotations` but kept the old name as an alias.

Annotations that have comment fields will also be in the printout now.

* fix: remove comment

* feat: `suggestannotation`

Pass in a term you want to make a new annotation for and it will check if any of the letters are not already used, or are OK to reuse.
2025-07-14 15:59:52 +00:00
Andrew Dunbar
92b964d038
chore: rename affixes.json to annotations.json (#1504)
Some checks are pending
Build Chrome Plugin / package (push) Waiting to run
Build Binaries / Release harper-cli - macOS-aarch64 (push) Waiting to run
Build Binaries / Release harper-cli - Linux-aarch64-GNU (push) Waiting to run
Build Binaries / Release harper-cli - Linux-aarch64-musl (push) Waiting to run
Build Binaries / Release harper-cli - macOS-x86_64 (push) Waiting to run
Build Binaries / Release harper-cli - Linux-x86_64-GNU (push) Waiting to run
Build Binaries / Release harper-cli - Linux-x86_64-musl (push) Waiting to run
Build Binaries / Release harper-cli - Windows-x86_64 (push) Waiting to run
Build Binaries / Release harper-ls - macOS-aarch64 (push) Waiting to run
Build Binaries / Release harper-ls - Linux-aarch64-GNU (push) Waiting to run
Build Binaries / Release harper-ls - Linux-aarch64-musl (push) Waiting to run
Build Binaries / Release harper-ls - macOS-x86_64 (push) Waiting to run
Build Binaries / Release harper-ls - Linux-x86_64-GNU (push) Waiting to run
Build Binaries / Release harper-ls - Linux-x86_64-musl (push) Waiting to run
Build Binaries / Release harper-ls - Windows-x86_64 (push) Waiting to run
Build Web / build (push) Waiting to run
Package VS Code Plugin / Package - darwin-arm64 (push) Waiting to run
Package VS Code Plugin / Package - darwin-x64 (push) Waiting to run
Package VS Code Plugin / Package - linux-arm64 (push) Waiting to run
Package VS Code Plugin / Package - linux-x64 (push) Waiting to run
Package VS Code Plugin / Package - win32-x64 (push) Waiting to run
Package WordPress Plugin / package (push) Waiting to run
Precommit / precommit (push) Waiting to run
* chore: rename `affixes.json` to `annotations.json`

The name was getting further and further from the function of the file. And the file is very important so a more representative name makes it less abstract when learning how Harper works.

* fix: mention old name `affixes.json`

I also noticed two fields in the sample entry had outdated names.

---------

Co-authored-by: Elijah Potter <me@elijahpotter.dev>
2025-07-07 16:41:17 +00:00
Renamed from harper-core/affixes.json (Browse further)