|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.wallstreetwise.app.jspell.domain.JSpellDictionary
com.wallstreetwise.app.jspell.domain.JSpellDictionaryLocal
public class JSpellDictionaryLocal
This class manages local access to a JSpell dictionary.
| Field Summary | |
|---|---|
static java.lang.String |
defaultCountry
System default country. |
static java.lang.String |
defaultDirectory
System default directory. |
static java.lang.String |
defaultLanguage
System default language. |
static java.lang.String |
defaultVersion
Default version. |
protected java.lang.String |
dictionaryCountry
The country code for the dictionary. |
protected java.lang.String |
dictionaryDirectory
The directory for the dictionary files. |
protected java.lang.String |
dictionaryLanguage
The language that this dictionary is using. |
protected java.lang.String |
dictionaryVersion
The version code for the dictionary. |
| Fields inherited from class com.wallstreetwise.app.jspell.domain.JSpellDictionary |
|---|
batchCount, batchSize, currentError, dictionaryReady, errorCache, errors, forceUpperCase, ignoreDoubleWords, ignoreFirstCaps, ignoreIrregularCaps, ignoreUpper, ignoreWords, ignoreWordsWithNumbers, learnWords, maxSuggestions, nextWord, suggestions, validWords |
| Constructor Summary | |
|---|---|
JSpellDictionaryLocal()
Constructor which accepts no parameters and sets the dictionary to the value of the defaultFile variable. |
|
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 |
getDictionaryCountry()
Returns the country of the dictionary. |
java.lang.String |
getDictionaryDirectory()
Returns the directory containing the JSpell dictionary. |
java.lang.String |
getDictionaryLanguage()
Returns the language of the dictionary. |
java.lang.String |
getDictionaryVersion()
Returns the version of the 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 |
boolean |
wordIsInIndex(java.lang.String wordToCheck)
|
| Methods inherited from class com.wallstreetwise.app.jspell.domain.JSpellDictionary |
|---|
addFrequentWords, adjustErrorPositions, checkCaps, checkCaps, getBatchSize, getCurrentError, getDictionaryReady, getForceUpperCase, getIgnoreDoubleWords, getIgnoreFirstCaps, getIgnoreIrregularCaps, getIgnoreUpper, getIgnoreWordsWithNumbers, getLearnWords, getNextError, ignoreWord, init, learnWordManual, resetAll, resetErrors, setBatchSize, setDictionaryReady, setForceUpperCase, setIgnoreDoubleWords, setIgnoreFirstCaps, setIgnoreIrregularCaps, setIgnoreUpper, setIgnoreWordsWithNumbers, setLearnWords, setMaxSuggestions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String dictionaryLanguage
protected java.lang.String dictionaryCountry
protected java.lang.String dictionaryVersion
protected java.lang.String dictionaryDirectory
public static java.lang.String defaultLanguage
public static java.lang.String defaultCountry
public static java.lang.String defaultDirectory
public static java.lang.String defaultVersion
| 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].| 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 getDictionaryLanguage()
public final java.lang.String getDictionaryCountry()
public final java.lang.String getDictionaryVersion()
public final java.lang.String getDictionaryDirectory()
public final void open()
throws JSpellException
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)
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()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||