Class SpellCheckSuggestion
- java.lang.Object
-
- com.broadleafcommerce.search.api.domain.SpellCheckSuggestion
-
- All Implemented Interfaces:
Serializable
public class SpellCheckSuggestion extends Object implements Serializable
Represents a set of spelling suggestions on a spelling corrected term. Includes the offsets of the term location(s) in the original query so that it can be replaced.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpellCheckSuggestion.TermPosition
-
Constructor Summary
Constructors Constructor Description SpellCheckSuggestion(String incorrectWord, List<String> suggestions, int startOffset, int endOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String word)
Adds a word to the suggestion list.void
addAll(List<String> words)
Adds a list of words to the suggestion list.void
addOccurrence(int startOffset, int endOffset)
Adds an additional occurrence of this term in the search query.protected boolean
canEqual(Object other)
boolean
equals(Object o)
String
getIncorrectWord()
The original word in the search query that is misspelled.List<SpellCheckSuggestion.TermPosition>
getOffsets()
The offset positions of this string in the original query.List<String>
getSuggestions()
The suggested terms to replace the corrected word, ordered by recommendation.int
hashCode()
void
setIncorrectWord(String incorrectWord)
The original word in the search query that is misspelled.void
setOffsets(List<SpellCheckSuggestion.TermPosition> offsets)
The offset positions of this string in the original query.void
setSuggestions(List<String> suggestions)
The suggested terms to replace the corrected word, ordered by recommendation.String
toString()
-
-
-
Constructor Detail
-
SpellCheckSuggestion
public SpellCheckSuggestion(String incorrectWord, List<String> suggestions, int startOffset, int endOffset)
- Parameters:
incorrectWord
- The incorrectly spelled wordsuggestions
- The suggested spelling corrections for the incorrect wordstartOffset
- The starting index in the original query of the incorrectly spelled stringendOffset
- The ending index in the original query of the incorrectly spelled string
-
-
Method Detail
-
add
public void add(String word)
Adds a word to the suggestion list.- Parameters:
word
- Suggested word.
-
addAll
public void addAll(List<String> words)
Adds a list of words to the suggestion list.- Parameters:
words
- Suggested words.
-
addOccurrence
public void addOccurrence(int startOffset, int endOffset)
Adds an additional occurrence of this term in the search query.- Parameters:
startOffset
- The starting index in the original query of the incorrectly spelled stringendOffset
- The ending index in the original query of the incorrectly spelled string
-
getIncorrectWord
public String getIncorrectWord()
The original word in the search query that is misspelled.- Returns:
- original word in the search query that is misspelled
-
getSuggestions
public List<String> getSuggestions()
The suggested terms to replace the corrected word, ordered by recommendation.- Returns:
- suggested terms to replace the corrected word
-
getOffsets
public List<SpellCheckSuggestion.TermPosition> getOffsets()
The offset positions of this string in the original query. This is a list, as it's possible for a single term to appear multiple times in a single query.- Returns:
- offset positions of this string in the original query
-
setIncorrectWord
public void setIncorrectWord(String incorrectWord)
The original word in the search query that is misspelled.- Parameters:
incorrectWords
- original word in the search query that is misspelled
-
setSuggestions
public void setSuggestions(List<String> suggestions)
The suggested terms to replace the corrected word, ordered by recommendation.- Parameters:
suggestions
- suggested terms to replace the corrected word
-
setOffsets
public void setOffsets(List<SpellCheckSuggestion.TermPosition> offsets)
The offset positions of this string in the original query. This is a list, as it's possible for a single term to appear multiple times in a single query.- Parameters:
offset
- offset positions of this string in the original query
-
canEqual
protected boolean canEqual(Object other)
-
-