lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Updated) (JIRA)" <>
Subject [jira] [Updated] (LUCENE-3820) Wrong trailing index calculation in PatternReplaceCharFilter
Date Thu, 23 Feb 2012 03:03:50 GMT


Robert Muir updated LUCENE-3820:

    Attachment: LUCENE-3820_test.patch

updated patch, this tests only ascii (to avoid stupid problems in outdated regex support).

But there are a lot of offset problems (perhaps this corresponds to the warning in the class's
javadocs?), including things like offsets being corrected to negative numbers...
> Wrong trailing index calculation in PatternReplaceCharFilter
> ------------------------------------------------------------
>                 Key: LUCENE-3820
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>             Fix For: 4.0
>         Attachments: LUCENE-3820.patch, LUCENE-3820_test.patch, LUCENE-3820_test.patch
> I need to use PatternReplaceCharFilter's index corrections directly and it fails for
me -- the trailing index is not mapped correctly for a pattern "\\.[\\s]*" and replacement
".", input "A. .B.".
> I tried to understand the logic in getReplaceBlock but I eventually failed and simply
rewrote it from scratch. After my changes a few tests don't pass but I don't know if it's
the tests that are screwed up or my logic. In essence, the difference between the previous
implementation and my implementation is how indexes are mapped for shorter replacements. I
shift indexes of shorter regions to the "right" of the original index pool and the previous
patch seems to squeeze them to the left (don't know why though).
> If anybody remembers how it's supposed to work, feel free to correct me?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message