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

Jaro winkler similarity on Empty strings #65

Open
santhosh6328 opened this issue Nov 24, 2022 · 3 comments
Open

Jaro winkler similarity on Empty strings #65

santhosh6328 opened this issue Nov 24, 2022 · 3 comments

Comments

@santhosh6328
Copy link

I am using jaro wrinkler similarity to check similarities between names. In one of the use case, i found this issue.
s1 = "SOME NAME" - s2 = "" -> similarity = 1
Why is the output "1". shouldn't "1" be for exact matches ?
please help

version details : java-string-similarity -> 2.0.0

@denmase
Copy link
Contributor

denmase commented Dec 5, 2022

@santhosh6328

Can you attach your source code? I tried similarity for those strings, and it returned 0 (correct). Perhaps you mixed similarity with distance. Those are completely different things.

        System.out.println("Similarity: " + jw.similarity("SOME NAME", ""));
        System.out.println("Distance: " + jw.distance("SOME NAME", ""));

@paulirwin
Copy link
Contributor

Also note that this scenario is covered via unit tests (see the NullEmptyTests class and its usage in the Jaro Winkler unit tests).

@potatoxf
Copy link

potatoxf commented Aug 29, 2023 via email

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

No branches or pull requests

4 participants