com.atlassian.confluence.search.didyoumean
Interface WordSuggester

All Known Implementing Classes:
LuceneWordSuggester

public interface WordSuggester

Class that provides word suggestions. The suggestion can be either a word with the correct spelling or one that appears more often in the search index. It is important to note that the spelling of a suggestion may not necessarily be correct, as this suggester serves words that are collected from Confluence content (which can contain errors).


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 suggestions, 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.
 

Method Detail

suggest

String suggest(String word)

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

Parameters:
word - a word to get a spelling suggestion on
Returns:
a suggestion for the specified word or null if no suggestion could be found
Throws:
IndexIOException - if there was an error reading the index while processing this request

suggest

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. 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, 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

Parameters:
word - a word
checkSuggestionFrequency - whether or not to rank suggestions by the frequency in which they appear in Confluence content.
Returns:
a suggestion for the specified word or null if no suggestion could be found
Throws:
IndexIOException - if there was an error reading the index while processing this request

suggest

List<String> suggest(String word,
                     int suggestions,
                     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. Only the case of the first letter of the specified word will be preseved in the suggestion.

Parameters:
word - a word
suggestions - a list of ranked suggestions
checkSuggestionFrequency - whether or not to consider the frequency of a suggestion in COnfluence's index for ranking purposes.
Returns:
a ranked list of suggestions for the specified word.
Throws:
IndexIOException - if there was an error reading the index while processing this request

isMemberOfVocabulary

boolean isMemberOfVocabulary(String word)
The vocabulary is composed of words sourced from Confluence content and the bundled dictionary.

Parameters:
word - a word
Returns:
true if the word is part of the vocabulary, false otherwise.


Copyright © 2003-2011 Atlassian. All Rights Reserved.