lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Naber (JIRA)" <>
Subject [jira] Commented: (LUCENE-763) LuceneDictionary skips first word in enumeration
Date Wed, 30 May 2007 20:40:16 GMT


Daniel Naber commented on LUCENE-763:

Thanks for your patch. I think there's a problem with the iterator which might not occur often,
but it should be fixed nonetheless: calling next() only has an effect if hasNext() has been
called before. You can see that by commenting out "assertTrue("Second element doesn't exist.",
it.hasNext());" in the test case: the test will then fail, although, to my understanding,
hasNext() should have no side effects. Could you change you patch accordingly?

> LuceneDictionary skips first word in enumeration
> ------------------------------------------------
>                 Key: LUCENE-763
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.0
>         Environment: Windows Sun JRE 1.4.2_10_b03
>            Reporter: Dan Ertman
>         Attachments:,
> The current code for LuceneDictionary will always skip the first word of the TermEnum.
The reason is that it doesn't initially retrieve TermEnum.term - its first call is to,
which moves it past the first term (line 76).
> To see this problem cause a failure, add this test to TestSpellChecker:
> similar = spellChecker.suggestSimilar("eihgt",2);
>       assertEquals(1, similar.length);
>       assertEquals(similar[0], "eight");
> Because "eight" is the first word in the index, it will fail.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message