lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3920) ShingleFilter sometimes confuses offsets
Date Mon, 26 Mar 2012 01:50:25 GMT


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:

    [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,class org.apache.lucene.analysis.hi.HindiStemFilter

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 >

> ShingleFilter sometimes confuses offsets
> ----------------------------------------
>                 Key: LUCENE-3920
>                 URL:
>             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:!default.jspa
For more information on JIRA, see:


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

View raw message