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

With version 5 upgrade, suggestions are very limited for short words #753

Closed
4 of 19 tasks
SLKnutson opened this issue Dec 15, 2020 · 4 comments · Fixed by #872
Closed
4 of 19 tasks

With version 5 upgrade, suggestions are very limited for short words #753

SLKnutson opened this issue Dec 15, 2020 · 4 comments · Fixed by #872

Comments

@SLKnutson
Copy link

Info

Kind of Issue

  • runtime - command-line tools
  • building / compiling
  • security
  • change in behavior
  • crash / error

Which Tool or library

  • cspell -- the command-line spelling tool
  • cspell-tools -- used for building dictionary files
  • cspell-lib -- library that does the actual spell checking.
  • cspell-trie -- tool for working with trie files.

Which Version

Version: 5.0.6

Issue with supporting library?

  • No
  • cspell-glob -- library for matching glob patterns
  • cspell-io -- thin file i/o library
  • cspell-trie-lib - trie lib
  • cspell-trie2-lib - trie lib alternate format
  • cspell-util-bundle - util bundle to reduce install size

OS:

  • Macos
  • Linux
  • Windows
  • Other

Bug Description

Before upgrading to version 5, our suggestions for "Im" would include "I'm", now we get no suggestions

To Reproduce

Looking at the code, I think it's generally reproducible, but we don't use the cli.

Expected behavior

Should get more suggestions for short words

Additional context

Looks like suggestions are getting filtered out by
let maxCost: number = Math.min((baseCost * wordToMatch.length) / 2, baseCost * changeLimit);
where the (baseCost * wordToMatch.length) / 2 relies on constants user code doesn't have access to. My understanding is far from perfect, but it seems like post upgrade the cost for an insertion exceeds this threshold for a 2 letter words.

Thanks! I love this library!

@Jason3S
Copy link
Collaborator

Jason3S commented Dec 16, 2020

Thank you for the bug report.
Do you have some example words in addition to Im?

@SLKnutson
Copy link
Author

Here are a few I could come up with. I would test using "Code Spell Checker" to give you something that would be 100% reproducible on your end, but it looks like that doesn't use v5 yet. We are not using the exact same english dictionary but the problem should still manifest:
ba Used to get many options including different capitalizations, and bad, bay, bag, ban, bat, ab..., now we get only different capitalizations and ab
hn Used to get hon and hen, now nothing
bn Used to get bin, ban, and bun, now nothing
yp Used to get yap, yep, yip, yup, and gyp, now nothing

Thanks!

@SLKnutson
Copy link
Author

Than you!

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants