|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dotmarketing.util.DotSpellChecker
public class DotSpellChecker
Class used via AJAX to spell checks fields in the dotCMS This class internally uses the Jazzy library and method to perform the spellchecking
| Nested Class Summary | |
|---|---|
class |
DotSpellChecker.DotWordFinder
Class internally used to match the words to spell check |
class |
DotSpellChecker.MisspelledWord
This class represent a misspelled word in the process of spelling check. |
| Constructor Summary | |
|---|---|
DotSpellChecker()
DotSpellCheck constructor This method will try to initialize the dictionaries if they weren't initilized before. |
|
| Method Summary | |
|---|---|
void |
addToDictionary(java.lang.String newWord)
Adds a word to the current dictionary. |
boolean |
changeDictionary(java.lang.String newDict)
This method changes the current dictionrary used to do the spell checking |
java.lang.String |
getCurrentDictionary()
Returns the current dictionary used by the class |
java.lang.String[] |
getDictionaries()
Returns the list of possible dictionaries found in the system |
DotSpellChecker.MisspelledWord |
getNextMisspelledWord()
Returns the next misspelled word found and the posible corrections. |
DotSpellChecker.MisspelledWord |
getSuggestions(java.lang.String nextWord)
This method allows you to find suggestions for a single word without starting the whole spelling process over a text. |
static void |
initializeDicts(boolean force,
boolean sync)
This method is used at the server startup to initialize the dictionaries, the dictionaries initilization process is a very time consuming task, that's why this process uses a separate thread to initialize the dictionaries on background. |
java.lang.String |
replaceWord(java.lang.String newWord)
Replace the current mispelled word by the given word. |
void |
startSpellChecking(java.lang.String text)
Triggers the spelling check of the given text |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DotSpellChecker()
throws java.io.FileNotFoundException,
java.io.IOException
java.io.IOException - If the process found an error reading the dictionaries
java.io.FileNotFoundException - If the dictionaries are not found| Method Detail |
|---|
public static void initializeDicts(boolean force,
boolean sync)
force - true If you want to force a reinitialization even if the dictionaries were already loaded before.sync - true If you want to wait until the initialization finishespublic java.lang.String getCurrentDictionary()
public boolean changeDictionary(java.lang.String newDict)
throws java.io.FileNotFoundException,
java.io.IOException
newDict - The new dictionary to set
java.io.FileNotFoundException - If the dictionary file wasn't found
java.io.IOException - If the process wasn't able to read the new dictionary.public void startSpellChecking(java.lang.String text)
text - The text to check.public DotSpellChecker.MisspelledWord getNextMisspelledWord()
public java.lang.String replaceWord(java.lang.String newWord)
newWord - The correction to set.
public void addToDictionary(java.lang.String newWord)
newWord - The new word to be added to the dictionary.public DotSpellChecker.MisspelledWord getSuggestions(java.lang.String nextWord)
nextWord - Word to find spelling suggestions
public java.lang.String[] getDictionaries()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||