Lucene - Core
  1. Lucene - Core
  2. LUCENE-1548

LevenshteinDistance code normalization is incorrect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.3.1, 2.3.2, 2.4
    • Fix Version/s: 2.4.1, 2.9
    • Component/s: modules/spellchecker
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      The normalization of the edit distance should use the maximum of the two string being compared instead of the minimum. Otherwise negative distances are possible. The spell checker filters out edits below a certain threshold so this hasn't been a problem in practice.

      1. LUCENE-1548.patch
        4 kB
        Thomas Morton

        Activity

        Thomas Morton created issue -
        Hide
        Thomas Morton added a comment -

        Fixes issue (changes min to max in distance computation) and corrects unit tests.

        Show
        Thomas Morton added a comment - Fixes issue (changes min to max in distance computation) and corrects unit tests.
        Thomas Morton made changes -
        Field Original Value New Value
        Attachment LUCENE-1548.patch [ 12400985 ]
        Michael McCandless made changes -
        Assignee Michael McCandless [ mikemccand ]
        Hide
        Michael McCandless added a comment -

        Looks good, I'll commit. Thanks Thomas!

        Show
        Michael McCandless added a comment - Looks good, I'll commit. Thanks Thomas!
        Hide
        Michael McCandless added a comment -

        Thanks Thomas!

        Show
        Michael McCandless added a comment - Thanks Thomas!
        Michael McCandless made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.9 [ 12312682 ]
        Mark Miller made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12453452 ] Default workflow, editable Closed status [ 12563098 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12563098 ] jira [ 12584140 ]

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Thomas Morton
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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

                Development