|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.webchat.utils.SpellChecker
public class SpellChecker
The Spell checker is used to create spell session objects to iteratively fix spelling mistakes in text. Multiple languages are supported, with American English, British English, French, French Canadian, German, Italian and Spanish supported out of the box. Additional dictionaries can be purchases and used by simply putting them in jiveHome/spelling directory and calling reloadDictionaries().
The format to specify the language to use as parameters to methods in this class is the ISO code for the language (http://www-old.ics.uci.edu/pub/ietf/http/related/iso639.txt). The language may also contain a 2 digit country code (http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html) to specify country specific languages if they are supported. Example: 'en', 'en_US', 'en_GB'.
Constructor Summary | |
---|---|
SpellChecker()
|
Method Summary | |
---|---|
static void |
addCustomWord(java.lang.String word)
Adds a word to the global custom dictionary (the custom dictionary that is used for spell checking across all languages). |
static void |
addCustomWord(java.lang.String word,
java.lang.String language)
Adds a word to the custom dictionary for the specified language. |
static SpellSession |
createSession(java.lang.String text,
java.io.File c)
Creates a new SpellSession to spell check a text block. |
static SpellSession |
createSession(java.lang.String text,
java.lang.String language)
Creates a new SpellSession to spell check a text block. |
static SpellSession |
createSession(java.lang.String text,
java.lang.String language,
java.util.List ignoreWords)
Creates a new SpellSession to spell check a text block. |
static void |
deleteCustomWord(java.lang.String word)
Deletes a word from the global custom dictionary (the custom dictionary that is used for spell checking across all languages). |
static void |
deleteCustomWord(java.lang.String word,
java.lang.String language)
Deletes a word from the custom dictionary. |
static java.util.List |
getAvailableLanguages()
Return the list of languages that are available to use for spell checking. |
protected static com.wintertree.ssce.FileTextLexicon |
getCustomLexicon(java.lang.String language)
Returns the custom FileTextLexicon (dictionary) for the specified language. |
static java.lang.String[] |
getCustomWords()
Returns an array of all the words in the global custom dictionary (the custom dictionary that is used for spell checking across all languages). |
static java.lang.String[] |
getCustomWords(java.lang.String language)
Returns an array of all the words in the custom dictionary for the specified language. |
static com.wintertree.ssce.Lexicon[] |
getLexicons(java.lang.String language)
Returns the array of Lexicons (dictionaries) for the specified language. |
static void |
reloadDictionaries()
Re-initializes the spell-checking dictionaries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpellChecker()
Method Detail |
---|
public static SpellSession createSession(java.lang.String text, java.io.File c)
text
- the text to spell check.
public static SpellSession createSession(java.lang.String text, java.lang.String language)
text
- the text to spell check.language
- the language to use.
public static SpellSession createSession(java.lang.String text, java.lang.String language, java.util.List ignoreWords)
text
- the text to spell check.language
- the language to use.ignoreWords
- a list of words to ignore while spell checking
public static java.util.List getAvailableLanguages()
public static java.lang.String[] getCustomWords()
The custom dictionary contains words that don't appear in the normal dictionaries, but that should still be considered as being spelled correctly. Examples include company names, technical terms, or slang.
public static java.lang.String[] getCustomWords(java.lang.String language)
The language specified will be used to select the custom dictionary to be used. If a custom dictionary for the specified language is not found then this method will return null.
language
- the language to retrieve the custom words for
public static void addCustomWord(java.lang.String word)
The custom dictionary contains words that don't appear in the normal dictionaries, but that should still be considered as being spelled correctly. Examples include company names, technical terms, or slang.
word
- the word to add to the global custom dictionary.public static void addCustomWord(java.lang.String word, java.lang.String language)
The language specified will be used to select the custom dictionary to be used. If a custom dictionary for the specified language is not found then this method is a noop.
word
- the word to add to the custom dictionary.language
- the language to add the custom word topublic static void deleteCustomWord(java.lang.String word)
The custom dictionary contains words that don't appear in the normal dictionaries, but that should still be considered as being spelled correctly. Examples include company names, technical terms, or slang.
word
- the word to delete from the global custom dictionary.public static void deleteCustomWord(java.lang.String word, java.lang.String language)
The language specified will be used to select the custom dictionary to be used. If a custom dictionary for the specified language is not found then this method is a noop.
word
- the word to delete from the custom dictionary.language
- the language to delete the custom word frompublic static void reloadDictionaries()
public static com.wintertree.ssce.Lexicon[] getLexicons(java.lang.String language)
protected static com.wintertree.ssce.FileTextLexicon getCustomLexicon(java.lang.String language)
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |