Skip to content
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

Q: Is it possible to support per-language prefixes -a.k.a. do not flag words with prefixes like "un" or "pre" or "co"? #5286

Open
klonos opened this issue Feb 16, 2024 · 5 comments · May be fixed by streetsidesoftware/cspell-dicts#3129

Comments

@klonos
Copy link

klonos commented Feb 16, 2024

The following are some examples that CSpell flags as wrong.

Words like the above make sense in coding, although there may not be officially included in any dictionary, so they should not be flagged. Instead of adding individual such words in the various dictionaries, which is impractical and kinda silly, I believe that cspell should follow the following logic:

  • follow the same logic as currently
  • if a word is flagged as wrong, check if it begins with "un" before actually flagging it
  • exclude the "un" and treat the remainder of the word as the word to check, and check again
  • if the rest of the word checks out, then so does the one with the "un" prefix

I believe that there should be a way to define a list of such prefixes (and perhaps suffixes as well?), and that this configuration should be per language.

@Jason3S Jason3S transferred this issue from streetsidesoftware/cspell-dicts Feb 20, 2024
@Jason3S Jason3S changed the title Support per-language prefixes -a.k.a. do not flag words with prefixes like "un" or "pre" or "co" Q: Is it possible to support per-language prefixes -a.k.a. do not flag words with prefixes like "un" or "pre" or "co"? Feb 20, 2024
@Jason3S
Copy link
Collaborator

Jason3S commented Feb 20, 2024

@klonos,

Thank you for the suggestion.

Doing what you suggest is not technically hard, but it is hard to ensure it is correct.

For example, unred, cogreen, pretree, would all be considered correct by just prefixing words with un, co, or pre. In the case of unred it is a common spelling mistake for unread.

The dictionaries are pretty extensive. They consist of hundreds of thousands or even millions of words. Very large dictionaries are not an issue. The time to look up a word is based upon the length of a word, not the size of the dictionary. So adding unrendered to a dictionary isn't really and issue. It just takes a bit of time to add it to a word list.

@ADTC
Copy link
Contributor

ADTC commented Mar 31, 2024

One more: unoptimized

@Jason3S
Copy link
Collaborator

Jason3S commented Apr 1, 2024

@ADTC,

Please feel free to create a PR to add unoptimized and other words that you think are appropriate to the US English Dictionary

klonos added a commit to klonos/cspell-dicts that referenced this issue Apr 25, 2024
Fixes streetsidesoftware/cspell#5286

CSpell has been nagging about these words found in the Backdrop CMS codebase.
@klonos
Copy link
Author

klonos commented Apr 25, 2024

I just filed a PR that adds some words that start with the "un" prefix: streetsidesoftware/cspell-dicts#3129

Also adds instantiatable and uninstantiatable, as well as unoptimized suggested by @ADTC.

@ADTC
Copy link
Contributor

ADTC commented Apr 25, 2024

Thank you for picking that one up. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants