|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jspell.domain.JSpellDictionary
com.jspell.domain.JSpellDictionaryLocal
public class JSpellDictionaryLocal
This class manages local access to a JSpell dictionary.
| Field Summary | |
|---|---|
static java.lang.String |
defaultDirectory
System default directory. |
| Fields inherited from class com.jspell.domain.JSpellDictionary |
|---|
batchCount, batchSize, defaultCountry, defaultLanguage, defaultVersion, errors, language, learnWords, maxSuggestions, suggestions |
| Constructor Summary | |
|---|---|
JSpellDictionaryLocal()
Constructor which accepts no parameters and sets the dictionary to the value of the defaultFile variable. |
|
JSpellDictionaryLocal(java.lang.String directory,
Language language)
|
|
JSpellDictionaryLocal(java.lang.String directory,
java.lang.String language,
java.lang.String country)
Creates and initializes the JSpellDictionaryLocal object with the directory, language and country of the local dictionary. |
|
JSpellDictionaryLocal(java.lang.String directory,
java.lang.String language,
java.lang.String country,
java.lang.String version)
Creates and initializes the JSpellDictionaryLocal object with the directory, language and country of the local dictionary. |
|
| Method Summary | |
|---|---|
boolean |
checkWord(JSpellWordBundle word)
Accepts a JSpellWordBundle to be checked against the dictionary. |
boolean |
checkWord(JSpellWordBundle word,
Suggestions suggestions)
Check a JSpellWordBundle. |
void |
close()
Close the local dictionary. |
int |
getBufferHit()
Get buffering statistics |
int |
getBufferMiss()
Get buffering statistics |
java.lang.String |
getDictionaryDirectory()
Returns the directory containing the JSpell dictionary. |
void |
learnWord(java.lang.String word)
Persist a word to the dictionary file. |
void |
open()
This method is called to open the local dictionary. |
void |
removeWord(java.lang.String word)
Remove a word from the dictionary file. |
void |
resetBufferStatistics()
Reset buffer statistics |
void |
setDictionary(java.lang.String directory,
java.lang.String language,
java.lang.String country,
java.lang.String version)
Set the directory of the dictionary file, the language and country. |
void |
setDictionaryFileName(java.lang.String dictionaryFileName)
Deprecated. see setDictionaryDirectory |
java.lang.String |
toString()
|
boolean |
wordIsInIndex(java.lang.String wordToCheck)
Accepts a single word as a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String defaultDirectory
| Constructor Detail |
|---|
public JSpellDictionaryLocal()
public JSpellDictionaryLocal(java.lang.String directory,
java.lang.String language,
java.lang.String country)
directory - directory containing the JSpell dictionary file.language - The language of the dictionary.country - The country of the dictionary.
public JSpellDictionaryLocal(java.lang.String directory,
java.lang.String language,
java.lang.String country,
java.lang.String version)
directory - directory containing the JSpell dictionary file.language - The language of the dictionary.country - The country of the dictionary.version - The version of the dictionary, Medical, Legal, [custom].
public JSpellDictionaryLocal(java.lang.String directory,
Language language)
| Method Detail |
|---|
public final void setDictionary(java.lang.String directory,
java.lang.String language,
java.lang.String country,
java.lang.String version)
directory - directory where the dictionary file is located.language - language of the dictionary.country - country of the dictionary.public final void setDictionaryFileName(java.lang.String dictionaryFileName)
dictionaryFileName - no longer used.public final java.lang.String getDictionaryDirectory()
public final void open()
JSpellException - an Exception object if there was an error opening the dictionary.public final void close()
public final boolean checkWord(JSpellWordBundle word,
Suggestions suggestions)
throws java.lang.Exception
word - a JSpellWordBundle object.suggestions - a Suggestions object.
java.lang.Exception - an Exception object.public final boolean wordIsInIndex(java.lang.String wordToCheck)
wordToCheck - a String object.
java.lang.Exception - an Exception object.
public final boolean checkWord(JSpellWordBundle word)
throws java.lang.Exception
checkWord in interface JSpellDictionaryAccessorcheckWord in class JSpellDictionaryword - a JSpellWordBundle object.
java.lang.Exception - an Exception object.public final void learnWord(java.lang.String word)
learnWord in interface JSpellDictionaryAccessorlearnWord in class JSpellDictionaryword - a String.public final void removeWord(java.lang.String word)
word - a String.public final void resetBufferStatistics()
public final int getBufferHit()
public final int getBufferMiss()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||