Class SpellCheckerService

java.lang.Object
  |
  +--SpellCheckerService

public class SpellCheckerService
extends java.lang.Object


Constructor Summary
SpellCheckerService()
           
 
Method Summary
 void addWord(java.lang.String word, java.lang.String userDictionary)
          Adds a word to the user dictionary
 java.lang.String checkSpelling(java.lang.String words)
          Checks spelling using all default options
 java.lang.String checkSpelling(java.lang.String words, java.lang.String langauges, java.lang.String userDictionaries)
          Checks spelling using specified languages, and default options
 java.lang.String checkSpelling(java.lang.String words, java.lang.String languages, java.lang.String userDictionaries, java.lang.String format, boolean stripHTML, int numSuggestions, int searchDepth, boolean englishPhonetic, int charLimit)
          checks spelling
 void createUserDictionary(java.lang.String dictionaryName)
          Opens the user dictionary in memory
 boolean isSpelledWrong(java.lang.String word)
          Boolean result of a spell check.
 boolean isSpelledWrong(java.lang.String word, java.lang.String languages, java.lang.String userDictionaries)
          Boolean result of a spell check.
 boolean isSpelledWrong(java.lang.String word, java.lang.String languages, java.lang.String userDictionaries, int searchDepth, boolean englishPhonetic)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpellCheckerService

public SpellCheckerService()
Method Detail

addWord

public void addWord(java.lang.String word,
                    java.lang.String userDictionary)
             throws java.lang.Exception
Adds a word to the user dictionary

Parameters:
word - the word to add
userDictionary - the name of the user dictionary
java.lang.Exception

createUserDictionary

public void createUserDictionary(java.lang.String dictionaryName)
                          throws java.lang.Exception
Opens the user dictionary in memory

Parameters:
dictionaryName - the name of the dictionary
java.lang.Exception

checkSpelling

public java.lang.String checkSpelling(java.lang.String words)
                               throws java.lang.Exception
Checks spelling using all default options

Parameters:
words - the words to spell check
java.lang.Exception

checkSpelling

public java.lang.String checkSpelling(java.lang.String words,
                                      java.lang.String langauges,
                                      java.lang.String userDictionaries)
                               throws java.lang.Exception
Checks spelling using specified languages, and default options

Parameters:
words - the words to spell check
userDictionaries - a comma-serperated list of user dictionaries or text lexicons (eg "bob,joe"). If null or empty no user dictionaries are used.
java.lang.Exception

checkSpelling

public java.lang.String checkSpelling(java.lang.String words,
                                      java.lang.String languages,
                                      java.lang.String userDictionaries,
                                      java.lang.String format,
                                      boolean stripHTML,
                                      int numSuggestions,
                                      int searchDepth,
                                      boolean englishPhonetic,
                                      int charLimit)
                               throws java.lang.Exception
checks spelling

Parameters:
words - the words to check spelling on.
languages - a comma-seperated list of languages to use (eg "american,medical") if empty or null the default (american) is used
userDictionaries - a comma-serperated list of user dictionaries or text lexicons (eg "bob,joe"). If null or empty no user dictionaries are used.
format - the format results are returned in, either javascript or wddx (xml)
stripHTML - if true stripts the text of tags
numSuggestions - the number of suggestions to return, default is 14
searchDepth - the deepness of the spell checking search algorithm default is 50, higher values yeild better results, but slower searches
englishPhonetic - if true the english phonetic algorithm is used, this performs well on english dictionaries, but for other languages you will want to disable it.
charLimit - the max number of characters to check. Typically set to a high value
java.lang.Exception

isSpelledWrong

public boolean isSpelledWrong(java.lang.String word,
                              java.lang.String languages,
                              java.lang.String userDictionaries,
                              int searchDepth,
                              boolean englishPhonetic)
                       throws java.lang.Exception
Parameters:
word - a single word that is in question
languages - a comma-seperated list of languages to use (eg "american,medical") if empty or null the default (american) is used
userDictionaries - a comma-serperated list of user dictionaries or text lexicons (eg "bob,joe"). If null or empty no user dictionaries are used.
searchDepth - the deepness of the spell checking search algorithm default is 50, higher values yeild better results, but slower searches
Returns:
true if mispelled, false if spelled correct
java.lang.Exception

isSpelledWrong

public boolean isSpelledWrong(java.lang.String word)
                       throws java.lang.Exception
Boolean result of a spell check. Uses default options

Parameters:
word - word to spell check
Returns:
true if mispelled, false if spelled correct
java.lang.Exception

isSpelledWrong

public boolean isSpelledWrong(java.lang.String word,
                              java.lang.String languages,
                              java.lang.String userDictionaries)
                       throws java.lang.Exception
Boolean result of a spell check.

Parameters:
word - word to spell check
languages - a comma-seperated list of languages to use (eg "american,medical") if empty or null the default (american) is used
userDictionaries - a comma-serperated list of user dictionaries or text lexicons (eg "bob,joe"). If null or empty no user dictionaries are used.
Returns:
true if mispelled, false if spelled correct
java.lang.Exception