-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix Levenshtein distance calculation with match function. #4545
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.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @danielmai and @manishrjain)
worker/match.go, line 32 at r1 (raw file):
// required to change one word into the other. // // This implemention is optimized to use O(min(m,n)) space and is based on the
Is this comment still true after the changes?
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.
approved
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @danielmai and @manishrjain)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @manishrjain and @martinmr)
worker/match.go, line 32 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
Is this comment still true after the changes?
Yup, because the column
array is created.
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.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @manishrjain and @martinmr)
Fixes #4494.
We try to be smart about calculating the Levenshtein distance by short-circuiting the calculation based on the
max
-allowed distance, but that ends up returning incorrect distances.max
argumentThis change is