[ 
https://issues.apache.org/jira/browse/TEXT-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17318354#comment-17318354
 ] 

Bruno P. Kinoshita commented on TEXT-191:
-----------------------------------------

Thanks for reviewing it so quickly [~bradleyrumball] . I'll have some 3 weeks 
break in May, where I'm planning to release Text & Imaging. Or another 
committer may release it earlier too.

I'll tidy up my last commit message (forgot to prefix with the issue number) 
and merge it.

> I'd happily work on this and provide a PR for in a future version; it would 
> be great to hear everyone's thoughts!

That would be really great. Assuming there's no distance that needs some 
parameters to be created (in which case maybe we'd need something like a 
builder?). If you prepare a PR, it'd need to be a draft, as it shouldn't be 
merged before 2.0 as I think it breaks binary backward compatibility. But once 
we are ready for 2.0 we can merge and release it.

All the best,

Bruno

> JaroWinklerDistance returns the same values as JaroWinklerSimilarity
> --------------------------------------------------------------------
>
>                 Key: TEXT-191
>                 URL: https://issues.apache.org/jira/browse/TEXT-191
>             Project: Commons Text
>          Issue Type: Bug
>    Affects Versions: 1.9
>         Environment: Windows 10
> AdoptOpenJDK 11
>            Reporter: Alexander Foerster
>            Assignee: Bruno P. Kinoshita
>            Priority: Major
>              Labels: JaroWinkler, easyfix, newbie
>             Fix For: 1.10
>
>
>  
> The following two code snippets give the same output:
> {code:java}
> // checking similarity
> JaroWinklerSimilarity jws = new JaroWinklerSimilarity();
> System.out.println("SIMILARITY: " + jws.apply("foo", "foo") + "  " + 
> jws.apply("foo", "bar"));
> // SIMILARITY: 1.0  0.0{code}
> {code:java}
> // checking distance
> JaroWinklerDistance jwd = new JaroWinklerDistance();
> System.out.println("DISTANCE: " + jwd.apply("foo", "foo") + "  " + 
> jwd.apply("foo", "bar"));
> // DISTANCE: 1.0  0.0
> {code}
> I would expect the distance to be 1 - similarity, but as you can see distance 
> and similarity return the same values.
>  
> An easy fix would be to use the commented lines in JaroWinklerDistance.java:
> {code:java}
> // JaroWinklerSimilarity similarity = new JaroWinklerSimilarity();
> // return 1 - similarity.apply(left, right);
> {code}
> and maybe make _similarity_ be a final property/variable.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to