Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1269

Wrong name or result of StringUtils::getJaroWinklerDistance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 3.3, 3.4, 3.5
    • None
    • None
    • None

    Description

      The name of the method StringUtils::getJaroWinklerDistance is misleading.
      Currently for equal strings 1 is returned, for completely different strings 0 is returned. That is a measure of similarity, not of a distance. A distance must be 0 for equal strings. I read on the issues LANG-591 and LANG-944, that it was decided to have a similar name to StringUtils::getLevenshteinDistance, but that requires also the change of the methods result.

      Could you please (1) rename the method to StringUtils::getJaroWinklerSimilarity or (2) change the method to return 1 - currentResult?

      First option has the disadvantage to lose the similar naming of the similar methods, second option implies the risk to unnoticed introduce bugs in depending code. So I think it is preferable to use the first option.

      Attachments

        Issue Links

          Activity

            People

              pascalschumacher Pascal Schumacher
              jmkeil Jan Martin Keil
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: