java-string-similarity
java-string-similarity copied to clipboard
Jaro winkler similarity on Empty strings
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
@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", ""));
Also note that this scenario is covered via unit tests (see the NullEmptyTests class and its usage in the Jaro Winkler unit tests).
这是来自QQ邮箱的自动回复邮件。 您好,我已经收到您的邮件