You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bruno P. Kinoshita (Jira)" <ji...@apache.org> on 2021/05/11 22:47:00 UTC

[jira] [Resolved] (TEXT-206) JaroWinklerDistance returning its compliment, ie 1 - distance

     [ https://issues.apache.org/jira/browse/TEXT-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruno P. Kinoshita resolved TEXT-206.
-------------------------------------
    Resolution: Duplicate

> JaroWinklerDistance returning its compliment, ie 1 - distance
> -------------------------------------------------------------
>
>                 Key: TEXT-206
>                 URL: https://issues.apache.org/jira/browse/TEXT-206
>             Project: Commons Text
>          Issue Type: Bug
>    Affects Versions: 1.9
>         Environment: Mac OS, jdk-15.0.1.jdk
>            Reporter: Glen Edmonds
>            Priority: Critical
>              Labels: distance
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> This class is returning {{1 - distance}}, but its contract is to return {{distance}}.
> These are some examples from in the javadoc of the {{apply()}} method:
> {{distance.apply("foo", "foo") = 0.0}}
> {{distance.apply("hello", "hallo") = 0.12}}
> {{distance.apply("fly", "ant") = 1.0}}
> but execution of the method produces the compliment: 1.0, 0.88 and 0.0
> Test code:
> {{System.out.println(new JaroWinklerDistance().apply("foo", "foo"));}}
> {{System.out.println(new JaroWinklerDistance().apply("hello", "hallo"));}}
> {{System.out.println(new JaroWinklerDistance().apply("fly", "ant"));}}
> Actual output:
> {{1.0}}
> {{0.88}}
> {{0.0}}
> Expected output:
> {{0.0}}
> {{0.12}}
> {{1.0}}
> Java version: jdk-15.0.1.jdk



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