Tolerance rate in Complishon#19456
Open
omarabedelkader wants to merge 5 commits intopharo-project:Pharo14from
Open
Tolerance rate in Complishon#19456omarabedelkader wants to merge 5 commits intopharo-project:Pharo14from
omarabedelkader wants to merge 5 commits intopharo-project:Pharo14from
Conversation
Contributor
Author
|
By default the tolerance rate is |
Contributor
Author
|
Failed tests are unrealated |
Member
|
I'm wondering if we could not add a strategy and delegate to it. Like that we could avoid the duplication of the call chain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds typo-tolerant completion to the completion engine.
At the moment, completion depends on exact prefix matching. This means that a small typo can prevent the expected completion from appearing, even when the intended candidate is obvious. That makes completion less helpful in one of the situations where it should help the most: while the user is actively typing and makes a minor mistake.
To improve this, this PR introduces approximate matching based on the normalized Damerau-Levenshtein distance. When enabled, the completion engine can tolerate small typing errors and still propose close candidates. Exact prefix matches are preserved and still ranked first, while fuzzy matches are only considered as a fallback and are sorted by similarity.
For example,
CoCompletionTolerance rate:0.4Colorand the user types a close but incorrect form such asClororColr, completion can still suggestColoror
P.S: The main trade-off is that increasing the tolerance too much can cause incorrect matches, so completion becomes noisy.