-
Notifications
You must be signed in to change notification settings - Fork 173
feat(core): added a bunch more common rules #940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
try to disable in my fork
} | ||
|
||
fn description(&self) -> &'static str { | ||
"Corrects the archaic or mistaken `fro` to `for` when followed by a noun." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Corrects the archaic or mistaken `fro` to `for` when followed by a noun." | |
"Corrects the archaic or mistaken `fro` to `for`, or `from` when followed by a noun." |
It could be a typo about fro
used instead of from
I received a letter fro Sarah
I received a letter from Sarah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, while fro
is archaic, it's irrelevant since it's not an archaic form of for
. It's an archaic form of from
and is only used these days in to and fro
.
I wonder if some logic for rare/archaic words could have a flag in the dictionary to allow them to get a warning and still undergo spellcheck. We'd want to find other instances similar to fro
for that to be worthwhile. I know that back in the day spellcheck dictionaries purposefully left words out that were correct but rare and likely to cause confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you suggest we change the description, or remove this rule as well as the dictionary entry for fro
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you suggest we change the description, or remove this rule as well as the dictionary entry for
fro
?
I would probably test if the spellcheck handles it. I've noticed it often doesn't make what I consider the 'obvious' suggestions for many mistakes. I haven't checked this one.
If the spellcheck suggests 'for' and 'from' we can probably do without the rule, but if it fails to suggest those then it's probably worth keeping the rule with a changed description.
At some point we probably want to add some code to 'score' suggestions in other ways than just pure edit distance to help get the best 3 into the suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's been around for a while now. See harper-core/src/spell/mod.rs
fn score_suggestion
. I've tweaked it a bit, but I'm not sure how to achieve the desired behavior.
I think we should keep the rule with an updated description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's been around for a while now. See
harper-core/src/spell/mod.rs
fn score_suggestion
. I've tweaked it a bit, but I'm not sure how to achieve the desired behavior.
Nice! I hadn't spotted it - will play with it at some point.
I have no idea what is going here with all the merge commits. |
I think about a month ago I tried to submit a PR to your PR or feature branch... or something like that. And it seemed to work at the time... but it seems to have caused this awfulness in the longer run. The worst case could be if my master somehow got in there because I turned off some of the GitHub CI stuff that didn't work in my fork and just kept causing recurring errors in my inbox. If it's my fault I sincerely apologize! |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [Automattic/harper/harper-ls](https://github.com/Automattic/harper) | minor | `v0.26.0` -> `v0.29.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>Automattic/harper (Automattic/harper/harper-ls)</summary> ### [`v0.29.1`](https://github.com/Automattic/harper/releases/tag/v0.29.1) [Compare Source](Automattic/harper@v0.29.0...v0.29.1) #### What's Changed - chore: "off of a" false positive by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1081 - feat: phrase corrections: like a plague, have went, case and point, aswell by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1078 - Dictionary curation 2025 04 17 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1080 - fix: [#​1075](Automattic/harper#1075) package logo font for vscode extension by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1077 **Full Changelog**: Automattic/harper@v0.29.0...v0.29.1 ### [`v0.29.0`](https://github.com/Automattic/harper/releases/tag/v0.29.0) [Compare Source](Automattic/harper@v0.28.0...v0.29.0) #### What's Changed - refactor: remove unneeded logic for repeated words by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1020 - fix: improve to handle -s -es and -ed endings by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1003 - feat: start clarifying affix system by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#972 - refactor: improve logic and robustness of then→than by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1021 - Curate existing rules by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1023 - fix: new logic and false positives by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1024 - build(deps): bump tokio from 1.44.1 to 1.44.2 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1040 - build(deps): bump indexmap from 2.8.0 to 2.9.0 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1037 - build(deps): bump uuid from 1.12.0 to 1.16.0 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1038 - feat: use the old code if `parallel` unavailable by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1019 - feat: mention which verb triggered lint in msg by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1034 - feat: Expand "cuz", correct "on face value" by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1030 - feat: exempt "you guys" from the possessive your linter by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1027 - feat: trail and error→trial and error by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1044 - chore: tweak priority/position of statusbar item and add Harper logo by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1043 - chore: "side of a" false positive by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1029 - feat: Add special cases to sentence capitalization by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1031 - feat: don't allow "let's" to trigger a following compound by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1032 - Dictionary curation 2025 04 04 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1028 - feature: highly kept (secret)→well-kept by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1045 - Documentation updates by [@​mcecode](https://github.com/mcecode) in Automattic/harper#1000 - chore: manually spotted 3 things our lints would flag in doc comments by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1047 - feat: sequential pronouns: don't detect "my US", make case insensitive by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1026 - feat(devshell): init devshell by [@​alDuncanson](https://github.com/alDuncanson) in Automattic/harper#1014 - `harper.js` API reference generation improvements by [@​mcecode](https://github.com/mcecode) in Automattic/harper#1050 - fix(comments): ignore comments CSpell compatibility by [@​mcecode](https://github.com/mcecode) in Automattic/harper#1046 - fix: update vscode deps by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1042 - feat: hone in on→home in on by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1059 - Adj of a curation 2025 04 09 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1053 - Dictionary curation 2025 04 08 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1052 - fix: make modal-of linter case insensitive by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1048 - build(deps): bump clap from 4.5.34 to 4.5.36 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1060 - build(deps): bump anyhow from 1.0.97 to 1.0.98 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1063 - build(deps): bump lru from 0.13.0 to 0.14.0 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1061 - build(deps): bump smallvec from 1.14.0 to 1.15.0 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1062 - feat(core): add simple corrections from my notes by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1025 - Fix bug 1066 "Stack Overflow", dictionary curation, adjective-of-a curation by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1068 - feat: add for (a)while, after (a)while, unless if, suffice to say by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1071 **Full Changelog**: Automattic/harper@v0.28.0...v0.29.0 ### [`v0.28.0`](https://github.com/Automattic/harper/releases/tag/v0.28.0) [Compare Source](Automattic/harper@v0.27.0...v0.28.0) #### What's Changed - fix(vscode-plugin): sleep a longer time after openUntitled by [@​kiding](https://github.com/kiding) in Automattic/harper#1004 - docs: update link to website by [@​alDuncanson](https://github.com/alDuncanson) in Automattic/harper#1007 - feat(harper-cli): make lint accept user & file-local dictionary by [@​kiding](https://github.com/kiding) in Automattic/harper#987 - feat(ls): use PlainEnglish parser for language id "text" by [@​86xsk](https://github.com/86xsk) in Automattic/harper#968 - docs: fix grammar by [@​alDuncanson](https://github.com/alDuncanson) in Automattic/harper#1009 - feat(comments): add `scala` support by [@​tymcauley](https://github.com/tymcauley) in Automattic/harper#970 - docs(core): update the `Author a Rule` page to align with code by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1008 - feat(core): make `LintConfig` sorted by key by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1012 - feat: wrote first draft of statistics logging by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#454 - feat(obsidian): add debounce setting by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1015 - feat(harper.js): significantly improve worker performance by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1016 - feat: [#​20](Automattic/harper#20) : comma spacing and [#​498](Automattic/harper#498) : Asian commas by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#891 - feat(core): added a bunch more common rules by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#940 - chore: merge and sort original and non-US sections by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#977 - Adj of a curation 2025 04 02 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1006 #### New Contributors - [@​alDuncanson](https://github.com/alDuncanson) made their first contribution in Automattic/harper#1007 - [@​tymcauley](https://github.com/tymcauley) made their first contribution in Automattic/harper#970 **Full Changelog**: Automattic/harper@v0.27.0...v0.28.0 ### [`v0.27.0`](https://github.com/Automattic/harper/releases/tag/v0.27.0) [Compare Source](Automattic/harper@v0.26.0...v0.27.0) #### What's Changed - fix(harper-ls): handle language mode change and VS Code auto detect by [@​kiding](https://github.com/kiding) in Automattic/harper#966 - feat: linters for common mistakes with "another" by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#963 - Dictionary curation 2025 03 06 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#837 - feat(core): flag "<adjective> of a" by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#967 - fix: include the full set of personal pronouns and possessives by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#964 - fix: 2 words in curated dict lack / before annotations by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#958 - feat: implement [#​828](Automattic/harper#828) by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#853 - VS Code Extension Updates by [@​mcecode](https://github.com/mcecode) in Automattic/harper#960 - doc(core): write up the difference between a `Linter` and a `PatternLinter` by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#973 - fix(core): remove bad phrase by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#974 - fix: handle another false positive in "adjective of a" by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#980 - feat(harper-typst): ignore file path as arguments, regex, .display by [@​kiding](https://github.com/kiding) in Automattic/harper#976 - Improve doc coverage by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#979 - feat: detect capitalized false positives by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#988 - fix(harper-cli): set American as the default dialect by [@​kiding](https://github.com/kiding) in Automattic/harper#986 - build(deps): bump once_cell from 1.21.1 to 1.21.3 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#996 - feat: more false positives: "inside of" & "out of" by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#992 - template for feature requests on github by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#981 - build(deps): bump clap from 4.5.32 to 4.5.34 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#995 - feat: implement [#​993](Automattic/harper#993) by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#994 - Dialect indicator for VS Code extension by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#985 - chore: "head of a" false positive + test by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#999 - test(core): confirm that [#​720](Automattic/harper#720) is no longer present by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#975 - fix(wordpress): crashes when options menu is opened by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1002 **Full Changelog**: Automattic/harper@v0.26.0...v0.27.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjguMCIsInVwZGF0ZWRJblZlciI6IjM5LjI0OC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Description
I've gone ahead and added a bunch more phrase corrections.
Checklist