-
Notifications
You must be signed in to change notification settings - Fork 893
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
Make suggestions based on Damerau-Levenshtein distance #1824
Conversation
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.
Not bad, some comments in-line, and the commit history will need a good rebase toward the end (be careful to retain retep007's authorship at that point).
In addition, I'd like to see at least one test which demonstrates what happens if there's nothing worth suggesting within the heuristic distance of 3. E.g. rustup component add banana
.
☔ The latest upstream changes (presumably #1833) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
So very almost there. Please fold the requested changes into the two main commits you have (i.e. where your initial implementation, and retep's changes lie.
I'll expect to see:
- commit 1: the clitools.rs update
- commit 2: your code (with fixes folded in)
- commit 3: retep's work (with fixes folded in)
If you can do that, I think this is mergeable, so remember to remove WIP:
from the title when you think you're ready for the final review before merge 😁
Thanks,
D.
In order to support testing commands which may return certain messages on `stderr` in a way in which they should *NOT* produce such messages, add a counterpart to `expect_not_stdout_ok`.
#1816
The only change that I'd suggest is to use Damerau-Levenshtein distance instead of Levenshtein distance, because the former adds transpositions to list of the basic operations. And as we know a lot of misspellings are made that way, even the example from issue is of this kind of error.