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

Minor refactoring of ERXStringUtilities.distance(). #312 #314

Merged
merged 3 commits into from
Nov 8, 2012

Conversation

paulhoadley
Copy link
Contributor

As described in #312, these commits add a new method, levenshteinDistance() (which returns an int), implements that method with the body of distance(), and then changes the implementation of distance() to use the new method. Further, we deprecate distance() (because it unnecessarily returns a double instead of an int), fix the Javadocs that originally documented distance(), and update ERXStringUtilitiesTest to show that none of this makes any functional difference.

This is really just a cut and paste of the implementation of 'double
distance(String, String)' into 'int levenshteinDistance(String,
String)', and a replacement of the body of the former method with a
call to the latter. (We don't even need a cast to go from int to
double.) We also take the opportunity to deprecate distance(), and
mark it for potential future removal. Note that distance() still
passes all the tests in ERXStringUtilitiesTest.testDistance().
darkv added a commit that referenced this pull request Nov 8, 2012
Minor refactoring of ERXStringUtilities.distance(). #312
@darkv darkv merged commit 0ed93d2 into wocommunity:integration Nov 8, 2012
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.

2 participants