|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.search.didyoumean.lucene.LuceneWordSuggester
public class LuceneWordSuggester
A service that is responsible for providing search suggestions determined from
searching a lucene based index. Also see javadoc for WordSuggester
.
Field Summary | |
---|---|
static org.apache.log4j.Logger |
log
Deprecated. |
Constructor Summary | |
---|---|
LuceneWordSuggester(com.atlassian.bonnie.ILuceneConnection didYouMeanLuceneConnection,
List<SuggestionsProvider> suggestionsProviders,
SuggestionFrequencyProvider suggestionFrequencyProvider)
|
Method Summary | |
---|---|
boolean |
isMemberOfVocabulary(String word)
The vocabulary is composed of words sourced from Confluence content and the bundled dictionary. |
String |
suggest(String word)
Provides a suggestion for the specified word. |
String |
suggest(String word,
boolean checkSuggestionFrequency)
Provides a suggestion for the specified word, and the option to enable/disable the searching of a word that appears more often in Confluence content. |
List<String> |
suggest(String word,
int numSuggestions,
boolean checkSuggestionFrequency)
Provides a suggestion for the specified word, providing the option to enable/disable ranking suggestions against the frequency in which they occur in Confluence content. |
List<String> |
suggestSimilar(String word,
int numSuggestions,
boolean enableSuggestionFreqRanking)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final org.apache.log4j.Logger log
Constructor Detail |
---|
public LuceneWordSuggester(com.atlassian.bonnie.ILuceneConnection didYouMeanLuceneConnection, List<SuggestionsProvider> suggestionsProviders, SuggestionFrequencyProvider suggestionFrequencyProvider)
Method Detail |
---|
public String suggest(String word)
WordSuggester
Provides a suggestion for the specified word. The suggestion can be either a word with the correct spelling or one that appears more often in the search index.
Returns null, if specified word length exceeds DidYouMean.Constants.MAX_INPUT_WORD_LENGTH
suggest
in interface WordSuggester
word
- a word to get a spelling suggestion on
public String suggest(String word, boolean checkSuggestionFrequency)
WordSuggester
Provides a suggestion for the specified word, and the option to enable/disable the searching of a word that appears more often in Confluence content. Only the case of the first letter of the specified word will be preseved in the suggestion.
If frequency ranking is disabled and the word already belongs to the
vocabulary (that is, WordSuggester.isMemberOfVocabulary(String)
is true), null
is returned. This simply means no suggestions are relevant for existing
vocabulary words.
Returns null, if specified word length exceeds DidYouMean.Constants.MAX_INPUT_WORD_LENGTH
suggest
in interface WordSuggester
word
- a wordcheckSuggestionFrequency
- whether or not to rank suggestions by the
frequency in which they appear in
Confluence content.
public List<String> suggest(String word, int numSuggestions, boolean checkSuggestionFrequency)
WordSuggester
Provides a suggestion for the specified word, providing the option to enable/disable ranking suggestions against the frequency in which they occur in Confluence content. Only the case of the first letter of the specified word will be preseved in the suggestion.
suggest
in interface WordSuggester
word
- a wordnumSuggestions
- a list of ranked suggestionscheckSuggestionFrequency
- whether or not to consider the frequency of a suggestion
in COnfluence's index for ranking purposes.
public boolean isMemberOfVocabulary(String word)
WordSuggester
isMemberOfVocabulary
in interface WordSuggester
word
- a word
public List<String> suggestSimilar(String word, int numSuggestions, boolean enableSuggestionFreqRanking)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |