|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.spelling.SpellingResult
public class SpellingResult
Implementations of SolrSpellChecker must return suggestions as SpellResult instance. This is converted into the required NamedList format in SpellCheckComponent.
Field Summary | |
---|---|
static int |
NO_FREQUENCY_INFO
|
Constructor Summary | |
---|---|
SpellingResult()
|
|
SpellingResult(Collection<Token> tokens)
|
Method Summary | |
---|---|
void |
add(Token token,
List<String> suggestions)
Adds a whole bunch of suggestions, and does not worry about frequency. |
void |
add(Token token,
String suggestion,
int docFreq)
Suggestions must be added with the best suggestion first. |
void |
addFrequency(Token token,
int docFreq)
Adds an original token with its document frequency |
LinkedHashMap<String,Integer> |
get(Token token)
Gets the suggestions for the given token. |
Map<Token,LinkedHashMap<String,Integer>> |
getSuggestions()
All the suggestions. |
Map<Token,Integer> |
getTokenFrequency()
|
Integer |
getTokenFrequency(Token token)
The token frequency of the input token in the collection |
Collection<Token> |
getTokens()
|
boolean |
hasTokenFrequencyInfo()
|
void |
setTokens(Collection<Token> tokens)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_FREQUENCY_INFO
Constructor Detail |
---|
public SpellingResult()
public SpellingResult(Collection<Token> tokens)
Method Detail |
---|
public void add(Token token, List<String> suggestions)
token
- The token to associate the suggestions withsuggestions
- The suggestionspublic void addFrequency(Token token, int docFreq)
token
- original tokendocFreq
- original token's document frequencypublic void add(Token token, String suggestion, int docFreq)
token
- The Token
suggestion
- The suggestion for the TokendocFreq
- The document frequencypublic LinkedHashMap<String,Integer> get(Token token)
token
- The Token
to look up
NO_FREQUENCY_INFO
.
The suggestions are added in sorted order (i.e. best suggestion first) then the iterator will return the suggestions in orderpublic Integer getTokenFrequency(Token token)
token
- The token
public boolean hasTokenFrequencyInfo()
public Map<Token,LinkedHashMap<String,Integer>> getSuggestions()
NO_FREQUENCY_INFO
if frequency info is not available.public Map<Token,Integer> getTokenFrequency()
public Collection<Token> getTokens()
public void setTokens(Collection<Token> tokens)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |