Class SpellCheckSuggestion
java.lang.Object
com.broadleafcommerce.search.api.domain.SpellCheckSuggestion
- All Implemented Interfaces:
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:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionSpellCheckSuggestion
(String incorrectWord, List<String> suggestions, int startOffset, int endOffset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a word to the suggestion list.void
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
boolean
The original word in the search query that is misspelled.The offset positions of this string in the original query.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.toString()
-
Constructor Details
-
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 Details
-
add
Adds a word to the suggestion list.- Parameters:
word
- Suggested word.
-
addAll
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
The original word in the search query that is misspelled.- Returns:
- original word in the search query that is misspelled
-
getSuggestions
The suggested terms to replace the corrected word, ordered by recommendation.- Returns:
- suggested terms to replace the corrected word
-
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
The original word in the search query that is misspelled.- Parameters:
incorrectWords
- original word in the search query that is misspelled
-
setSuggestions
The suggested terms to replace the corrected word, ordered by recommendation.- Parameters:
suggestions
- suggested terms to replace the corrected word
-
setOffsets
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
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-