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

Fix Jaro-Winkler result for two empty inputs #44

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

Conversation

mhuerster
Copy link

Resolves #43

After trying a few other libraries (https://github.com/kiyoka/fuzzy-string-match and
https://github.com/tonytonyjan/jaro_winkler), I've noticed that it seems more common to return 0
for two empty inputs than 1.

This PR implements and tests that behavior.

Resolves Yomguithereal#43

After trying a few other libraries (https://github.com/kiyoka/fuzzy-string-match and
https://github.com/tonytonyjan/jaro_winkler), I've noticed that it seems more common to return 0
for two empty inputs than 1.

This PR implements and tests that behavior.
@Yomguithereal
Copy link
Owner

Hum. That's quite strange. Conceptually, two empty strings are identical, so the similarity between them should be 1 not 0. I don't remember but I think my library computes the Jaro-Winkler similarity, not distance. The library you cite computes the distance here and returns correctly 0 distance between two empty strings, for instance https://github.com/tonytonyjan/jaro_winkler/blob/master/test/test_jaro_winkler.rb#L42

@lenaschoenburg
Copy link

Doc strings say they compute distance, not similarity

@Yomguithereal
Copy link
Owner

Yomguithereal commented Jul 3, 2017

@dignati you are right. There seems to be some kind of confusion in the doc strings. The function do compute the similarity, not the distance. My bad.

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

3 participants