fix(core): do not flag Dickens as a swear - #4031
Conversation
|
This looks like the right fix to me. Thanks. |
hippietrail
left a comment
There was a problem hiding this comment.
We're close. Let's make the dictionary entries nice and clean. Also this is still a draft - is that intentional?
| dicier/Jc | ||
| diciest/Ju | ||
| dick/~NgSV>XZx | ||
| dick/~NgSV>Zx |
There was a problem hiding this comment.
May as well remove > while we're at it. It generates dicker, which has its own entry anyway. So we should also remove x which apparently generates dickers if I'm not mistaken.
But then since the dicker entry doesn't generate a plural we should add /S to it.
I better look into "dicker" since I'm not sure I know it... OK so "dicker" is a verb so "dickered", "dickering", and "dickers" are all legit. Several dictionaries also list it as a noun, so let's go with
dick/~NgSVx
dicker/VdGS
Drop the `>` and `Z` agent-noun suffixes from `dick`. Both generated forms that `dicker` already provides, and the `x` swear property propagates, so they also marked `dicker` and `dickers` as swears. Add `S` to `dicker` so it keeps generating a plural now that `Z` is gone. Keep the existing `N`, since `S` targets `noun.is_plural` only when the base carries noun metadata; without `N` the generated `dickers` would be a verb form alone and the noun sense would be lost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G9k6gnF8CUtKAPo1LoLZyZ
|
Draft was not intentional, sorry about that. Marked ready for review. Cleaned up the entries as suggested. I did deviate from your snippet on one character and want to flag it rather than slip it past you. You wrote: The current entry is "target": [
{ "if_base": { "noun": {} }, "metadata": { "noun": { "is_plural": true } } },
{ "if_base": { "verb": {} }, "metadata": { "verb": { "verb_form": "THIRD_PERSON_SINGULAR" } } }
]Without Final entries: Checked the metadata after rebuilding:
I also checked whether anything else in the dictionary has this shape. Four other entries combine
|
AI disclosure: An AI agent implemented and tested this patch with direction from Mauro Pereira.
Issues
Fixes #1656.
Description
The
Xsuffix flag on bothDickanddickgeneratedDickensanddickens. Generated forms inherited metadata from their stems, so the lowercase path markedDickensas a swear when dictionary entries were merged.This removes the
Xflag from those stems and addsdickensexplicitly. The existingDickensentry remains the proper noun, the lowercase word remains accepted, anddickremains marked as a swear.Demo
Before this change,
Charles Dickens wrote many novels.triggeredAvoidCurses. It now produces no lint.What the dickens is going on?also remains accepted.How Has This Been Tested?
cargo test -p harper-corecargo test -qcargo run --bin harper-cli -- audit-dictionary harper-corecargo fmt -- --checkcargo clippy -- -Dwarnings -D clippy::dbg_macro -D clippy::needless_raw_string_hashescargo hack check --each-featurepnpm checkgit diff --checkAI Disclosure
If Your PR Implements or Enhances a Linter
Checklist