You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (Created) (JIRA)" <ji...@apache.org> on 2012/03/26 03:26:27 UTC

[jira] [Created] (LUCENE-3920) ShingleFilter sometimes confuses offsets

ShingleFilter sometimes confuses offsets
----------------------------------------

                 Key: LUCENE-3920
                 URL: https://issues.apache.org/jira/browse/LUCENE-3920
             Project: Lucene - Java
          Issue Type: Bug
    Affects Versions: 3.6, 4.0
            Reporter: Robert Muir
         Attachments: LUCENE-3920_test.patch

It seems like maybe its possibly applying the offsets from the wrong token?

Because after shingling, the resulting token has a startOffset thats after the endoffset.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3920) ShingleFilter sometimes confuses offsets

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238046#comment-13238046 ] 

Robert Muir commented on LUCENE-3920:
-------------------------------------

Now I understand the bug. Its not related to shingles (its just that shingles is a word-combiner).
just running the test on LUCENE-3919, I've tripped this with some other combinations,
like NGramTokenizer + HyphenatedWordsFilter, if the text ends with a hyphen:

{noformat}
    [junit] TEST FAIL: useCharFilter=true text='wonxkil ?-?-'
    [junit] Exception from random analyzer: tokenizer=class org.apache.lucene.analysis.ngram.NGramTokenizer
    [junit] filters=class org.apache.lucene.analysis.miscellaneous.HyphenatedWordsFilter,class org.apache.lucene.analysis.ga.IrishLowerCaseFilter,class org.apache.lucene.analysis.hi.HindiStemFilter
{noformat}

The problem is as Mike mentions on LUCENE-3907, the n-grams perform "multiple passes".
So imagine the text is 'abcd', if you ngram(1,2), they emit:
a, b, c, d, ab, bc, cd
instead of something like:
a, ab, b, bc, c, cd, d, ...

Because if this, if someone 'joins' the d and ab, they create a term with a startOffset > endOffset...

                
> ShingleFilter sometimes confuses offsets
> ----------------------------------------
>
>                 Key: LUCENE-3920
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3920
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.6, 4.0
>            Reporter: Robert Muir
>         Attachments: LUCENE-3920_test.patch
>
>
> It seems like maybe its possibly applying the offsets from the wrong token?
> Because after shingling, the resulting token has a startOffset thats after the endoffset.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3920) ngram tokenizer/filters create nonsense offsets if followed by a word combiner

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3920:
--------------------------------

    Summary: ngram tokenizer/filters create nonsense offsets if followed by a word combiner  (was: ShingleFilter sometimes confuses offsets)
    
> ngram tokenizer/filters create nonsense offsets if followed by a word combiner
> ------------------------------------------------------------------------------
>
>                 Key: LUCENE-3920
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3920
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.6, 4.0
>            Reporter: Robert Muir
>         Attachments: LUCENE-3920_test.patch
>
>
> It seems like maybe its possibly applying the offsets from the wrong token?
> Because after shingling, the resulting token has a startOffset thats after the endoffset.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3920) ShingleFilter sometimes confuses offsets

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238034#comment-13238034 ] 

Robert Muir commented on LUCENE-3920:
-------------------------------------

Note I havent debugged this enough to see if its really shinglefilter,
or actually a bug in ngrams filter, or somehow a crazy bug when
the two of them get together. Its just something I tripped in LUCENE-3919.
                
> ShingleFilter sometimes confuses offsets
> ----------------------------------------
>
>                 Key: LUCENE-3920
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3920
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.6, 4.0
>            Reporter: Robert Muir
>         Attachments: LUCENE-3920_test.patch
>
>
> It seems like maybe its possibly applying the offsets from the wrong token?
> Because after shingling, the resulting token has a startOffset thats after the endoffset.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3920) ShingleFilter sometimes confuses offsets

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3920:
--------------------------------

    Attachment: LUCENE-3920_test.patch

attached is a test
                
> ShingleFilter sometimes confuses offsets
> ----------------------------------------
>
>                 Key: LUCENE-3920
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3920
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.6, 4.0
>            Reporter: Robert Muir
>         Attachments: LUCENE-3920_test.patch
>
>
> It seems like maybe its possibly applying the offsets from the wrong token?
> Because after shingling, the resulting token has a startOffset thats after the endoffset.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org