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

False positives #240

Closed
dhardy opened this issue Dec 7, 2021 · 2 comments · Fixed by #243
Closed

False positives #240

dhardy opened this issue Dec 7, 2021 · 2 comments · Fixed by #243
Assignees
Labels
bug Something isn't working

Comments

@dhardy
Copy link

dhardy commented Dec 7, 2021

Hey, nice crate!

On applying this (see kas-gui/kas-text#62), I had to add a custom dictionary (it would be nice if this were easier, and if entries could be added directly from the "cargo fix" interactive CLI).

But the reason I opened this is due to several unexpected cases that are reported:

error: spellcheck(NlpRules)
   --> /home/dhardy/projects/kas/text/src/env.rs:70
    |
 70 |  Glyphs outside of these bounds may not be drawn.
    |         ^^^^^^^^^^

(2/2) Apply this suggestion [y,n,q,a,d,j,e,?]?

 » outside
   `outside of`
error: spellcheck(NlpRules)
    --> /home/dhardy/projects/kas/text/src/display.rs:223
     |
 223 |  Find the text index nearest horizontal-coordinate `x` on `line`
     |                                                        ^^^

(1/1) Apply this suggestion [y,n,q,a,d,j,e,?]?

 » online
   `on `
error: spellcheck(NlpRules)
   --> /home/dhardy/projects/kas/text/src/fonts/mod.rs:62
    |
 62 |  Warning: on MacOS and Apple systems, a *point* sometimes refers to a
    |              ^^^^^

(4/4) Apply this suggestion [y,n,q,a,d,j,e,?]?

 » macOS
   `MacOS`
error: spellcheck(Hunspell)
    --> /home/dhardy/projects/kas/text/src/raster.rs:102
     |
 102 |  Subjectively, readability and apparent quality is better up to around `dpem=18` (~13.5pt),
     |                                                                                       ^^^

(2/2) Apply this suggestion [y,n,q,a,d,j,e,?]?

   PT
   5 pt
   dpt
   opt
   apt
 » pt
   `5pt`
   ...
error: spellcheck(NlpRules)
    --> /home/dhardy/projects/kas/text/src/text.rs:319
     |
 319 |  Find the text index nearest horizontal-coordinate `x` on `line`
     |                                                        ^^^

(1/1) Apply this suggestion [y,n,q,a,d,j,e,?]?

 » online
   `on `

Cases 1, 2 and 5 make no sense to me. (I wondered about non-ASCII spaces/invisible chars, but rewriting doesn't fix.)

Case 3, MacOS, was added to the dictionary, yet still comes up.

Case 4 may not be a bug, but I'm not sure if there's some way of handling numeric suffixes?

@dhardy dhardy added the bug Something isn't working label Dec 7, 2021
@drahnr
Copy link
Owner

drahnr commented Dec 7, 2021

NlpRules is expected to be noisy, the next version will disable it by default and stick with hunspell only. You can get the same behavior with --checkers=hunspell, which is more appropriate for CI. If you have code tags they will be elipsized before being fed to nlprules, hence the high false-positive rate.

The dictionary is only relevant for hunspell, so nlprules is not affect - but it should not outline spelling mistakes anyways 🧐 So this is a bug.

Numeric suffixes can be handled with project specific quirks, if you find this is generalizable pattern, happy to add a builtin flag for this.

Regarding, interactive dictionary additions, #41 tracks that.

As always, happy to review incoming PRs :)

@drahnr
Copy link
Owner

drahnr commented Dec 9, 2021

Created #242 and #243 to track the relevant issues. Closing this in favor of those. Thanks for reporting!

@drahnr drahnr closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants