public class PossibilityIterator extends Object implements Iterator<PossibilityIterator.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.
Modifier and Type | Class and Description |
---|---|
class |
PossibilityIterator.RankedSpellPossibility |
Constructor and Description |
---|
PossibilityIterator(Map<Token,LinkedHashMap<String,Integer>> suggestions,
int maximumRequiredSuggestions,
int maxEvaluations,
boolean overlap)
We assume here that the passed-in inner LinkedHashMaps are already sorted
in order of "Best Possible Correction".
|
public PossibilityIterator(Map<Token,LinkedHashMap<String,Integer>> suggestions, int maximumRequiredSuggestions, int maxEvaluations, boolean overlap)
We assume here that the passed-in inner LinkedHashMaps are already sorted in order of "Best Possible Correction".
public boolean hasNext()
hasNext
in interface Iterator<PossibilityIterator.RankedSpellPossibility>
public PossibilityIterator.RankedSpellPossibility next()
next
in interface Iterator<PossibilityIterator.RankedSpellPossibility>
public void remove()
remove
in interface Iterator<PossibilityIterator.RankedSpellPossibility>
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.