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

feature: suggest nearest match if user give unrecognized option #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jangko
Copy link
Contributor

@jangko jangko commented Nov 2, 2021

similar to git Did you mean '...'?, this feature put std/editDistance
into action and help users to quickly recognize his error instead of plain
Unrecognized option '...'.

similar to git `Did you mean '...'?`, this feature put `std/editDistance`
into action help users to quickly recognize his error instead of plain
`Unrecognized option '...'.`
@jangko jangko requested a review from zah November 30, 2021 04:52
@zah
Copy link
Contributor

zah commented Nov 30, 2021

It would be better if we set some maximum allowed distance for suggesting an alternative.

@jangko
Copy link
Contributor Author

jangko commented Dec 1, 2021

If I understand correctly, does it mean we need to prevent the algorithm from giving a suggestion that is too far from what asked by user so it looks completely unrelated? Yes I observed sometime the algorithm give ridiculous feedback.

@zah
Copy link
Contributor

zah commented Dec 1, 2021

Yes, exactly. I think edit distance of 3 or 4 is the maximum reasonable one (but you can try different values to get idea how it works).

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

Successfully merging this pull request may close these issues.

None yet

2 participants