public class PossibilityIterator extends Object implements Iterator<RankedSpellPossibility>
Given a list of possible Spelling Corrections for multiple mis-spelled words in a query, This iterator returns Possible Correction combinations ordered by reasonable probability that such a combination will return actual hits if re-queried. This implementation simply ranks the Possible Combinations by the sum of their component ranks.
Constructor and Description |
---|
PossibilityIterator(Map<org.apache.lucene.analysis.Token,LinkedHashMap<String,Integer>> suggestions,
int maximumRequiredSuggestions,
int maxEvaluations)
We assume here that the passed-in inner LinkedHashMaps are already sorted
in order of "Best Possible Correction".
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
RankedSpellPossibility |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public PossibilityIterator(Map<org.apache.lucene.analysis.Token,LinkedHashMap<String,Integer>> suggestions, int maximumRequiredSuggestions, int maxEvaluations)
We assume here that the passed-in inner LinkedHashMaps are already sorted in order of "Best Possible Correction".
suggestions
- public boolean hasNext()
hasNext
in interface Iterator<RankedSpellPossibility>
public RankedSpellPossibility next()
next
in interface Iterator<RankedSpellPossibility>
public void remove()
remove
in interface Iterator<RankedSpellPossibility>
Copyright © 2006–2018 The Apache Software Foundation. All rights reserved.