Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-206

JaroWinklerDistance returning its compliment, ie 1 - distance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • 1.9
    • None
    • Mac OS, jdk-15.0.1.jdk

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bohemian Glen Edmonds
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified