[ 
https://issues.apache.org/jira/browse/LUCENE-6365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614706#comment-14614706
 ] 

Dawid Weiss edited comment on LUCENE-6365 at 7/6/15 8:44 AM:
-------------------------------------------------------------

I don't think so. The test in question (and the seed in question) fails because 
FiniteStringsIterator returns the same sequence twice ("h"), I just compared 
the outputs of the recursive and non-recursive outputs.

Looks like the seed in question adds the same string to the input automaton 
twice ("h") and then doesn't minimize/ determinize. getFiniteStringsRecursive 
makes sure no string is emitted twice, FiniteStringsIterator doesn't have this 
check.

Perhaps we should require that the input automaton doesn't have duplicates 
(Mike?). Alternatively, we could add compare-to-previous to the iterator and 
skip duplicates.


was (Author: dweiss):
I don't think so. The test in question (and the seed in question) fails because 
FiniteStringsIterator returns the same sequence twice ("h"), I just compared 
the outputs of the recursive and non-recursive outputs.

Looks like the seed in question adds the same string to the input automaton 
twice ("h") and then doesn't minimize/ determinize. getFiniteStringsRecursive 
makes sure no string is emitted twice, FiniteStringsIterator doesn't have this 
check.

> Optimized iteration of finite strings
> -------------------------------------
>
>                 Key: LUCENE-6365
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6365
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other
>    Affects Versions: 5.0
>            Reporter: Markus Heiden
>            Priority: Minor
>              Labels: patch, performance
>             Fix For: 5.3, Trunk
>
>         Attachments: FiniteStrings_noreuse.patch, FiniteStrings_reuse.patch, 
> LUCENE-6365.patch
>
>
> Replaced Operations.getFiniteStrings() by an optimized FiniteStringIterator.
> Benefits:
> Avoid huge hash set of finite strings.
> Avoid massive object/array creation during processing.
> "Downside":
> Iteration order changed, so when iterating with a limit, the result may 
> differ slightly. Old: emit current node, if accept / recurse. New: recurse / 
> emit current node, if accept.
> The old method Operations.getFiniteStrings() still exists, because it eases 
> the tests. It is now implemented by use of the new FiniteStringIterator.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to