Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3971

MappingCharFilter rarely has wrong correctOffset (for finalOffset)

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-ALPHA, 3.6.1
    • modules/analysis
    • None
    • New

    Description

      Found this bug over on LUCENE-3969, but I'm currently tracking a ton of bugs, so
      I figure I would open an issue and see if this one is obvious to anyone:

      Consider this input string: "gzw f quaxot" (length = 12) with a WhitespaceTokenizer.
      If i have mapping rules like this, then it works!:

      "t" => ""
      

      But if I have mapping rules like this:

      "t" => ""
      "tmakdbl" => "c"
      

      Then it will compute final offset wrong:

          [junit] junit.framework.AssertionFailedError: finalOffset  expected:<12> but was:<11>
      

      Looks like some logic/recursion bug in the correctOffset method? The second rule is not even "used" for this string,
      it just happens to also start with 't'

      Attachments

        1. LUCENE-3971_test.patch
          3 kB
          Robert Muir
        2. LUCENE-3971.patch
          3 kB
          Dawid Weiss

        Issue Links

          Activity

            People

              dweiss Dawid Weiss
              rcmuir Robert Muir
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: