|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.wallstreetwise.app.jspell.domain.JSpellDictionary
public abstract class JSpellDictionary
A JSpellDictionary is an abstract class that is the base class for all JSpell dictionary access classes. CVS Version ID $Id: JSpellDictionary.java,v 1.2 2005/09/07 14:50:23 clifford_admin Exp $
| Field Summary | |
|---|---|
protected int |
batchCount
This variable is used internally. |
protected int |
batchSize
This variable determines the number of words to send to the server in a single 'batch'. |
protected JSpellErrorInfo |
currentError
The current error being processed. |
protected boolean |
dictionaryReady
Was the dictionary opened successfully and can it be searched? |
protected java.util.HashMap |
errorCache
A HashMap containing the errors waiting to be processed. |
protected java.util.Vector |
errors
A Vector containing the errors returned by the spell checker. |
protected boolean |
forceUpperCase
When true, all suggestions returned by the spell checker will be in UPPER CASE. |
protected boolean |
ignoreDoubleWords
When true, JSpell will not flag an error if a word is repeated. |
protected boolean |
ignoreFirstCaps
If false and the first character in a field being spell checked is not capitalized then JSpell will flag an error. |
protected boolean |
ignoreIrregularCaps
When false, JSpell will flag an error if a word is at the beginning of a sentence but is not capitalized. |
protected boolean |
ignoreUpper
If true, JSpell will not attempt to spell check words that are in all UPPER CASE. |
protected java.util.HashMap |
ignoreWords
A HashMap of words to ignore. |
protected boolean |
ignoreWordsWithNumbers
When true, JSpell will ignore any words containing numbers and will not attempt to spell check them. |
protected boolean |
learnWords
If true, the user (local or server) may permanently add words to the dictionary. |
protected int |
maxSuggestions
The maximum number of suggestions to return. |
protected java.lang.String |
nextWord
This variable determines the number of words to send to the server in one spell check request. |
protected Suggestions |
suggestions
The suggestions for the incorrect word. |
protected java.util.HashMap |
validWords
A HashMap of all the validWords that have been accessed by the JSpell spell checker routines. |
| Constructor Summary | |
|---|---|
JSpellDictionary()
Constructs a JSpellDictionary object. |
|
| Method Summary | |
|---|---|
protected void |
addFrequentWords()
Loads validWords HashMap with frequently used words in the English language. |
void |
adjustErrorPositions(int offset)
Used to adjust the internal position references of the errors returned by the spell checker. |
boolean |
checkCaps(char curChar,
char prevChar)
This method determines if JSpell is at the end of a sentence. |
boolean |
checkCaps(char curChar,
char prevChar,
boolean hasDigits,
boolean capsFlag)
This method determines if JSpell is at the end of a sentence. |
boolean |
checkWord(JSpellWordBundle word)
Sends words to be checked by the dictionary. |
int |
getBatchSize()
Get the number of words that can be validated by this access interface before getting errors back |
JSpellErrorInfo |
getCurrentError()
Returns the current error from the dictionary. |
boolean |
getDictionaryReady()
Retrieves the ready state of the dictionary. |
boolean |
getForceUpperCase()
Is this dictionary configured to return suggestions in UPPER CASE. |
boolean |
getIgnoreDoubleWords()
Returns the ignoreDoubleWords variable. |
boolean |
getIgnoreFirstCaps()
Return whether this dictionary accessor ignores capitalization errors on the first word. |
boolean |
getIgnoreIrregularCaps()
Returns ignoreIrregularCaps variable. |
boolean |
getIgnoreUpper()
Returns the ignoreUpper variable. |
boolean |
getIgnoreWordsWithNumbers()
Returns the ignoreWordsWithNumbers variable. |
boolean |
getLearnWords()
Can words be added to the dictionary? |
JSpellErrorInfo |
getNextError()
Retrieves the next error from the dictionary. |
void |
ignoreWord(java.lang.String word)
Add a word to the list of words to ignore/not check. |
protected void |
init()
Initializes the JSpellDictionary object by creating the HashMaps, Vectors and other internal structures used by the JSpellDictionary object. |
void |
learnWord(java.lang.String word)
Add a new word to the dictionary. |
void |
learnWordManual(java.lang.String word)
Add a word to the internal dictionary but don't persist it to local storage or a network dictionary. |
void |
resetAll()
Resets the state of the dictionary. |
void |
resetErrors()
Resets any pending errors. |
void |
setBatchSize(int batchSize)
Set the number of words to validate in one call to the dictionary access interface. |
protected void |
setDictionaryReady(boolean newValue)
Sets the ready state of the dictionary. |
void |
setForceUpperCase(boolean forceUpperCase)
When true, causes all suggestions to be in UPPER CASE. |
void |
setIgnoreDoubleWords(boolean ignoreDoubleWords)
Sets the ignoreDoubleWords variable. |
void |
setIgnoreFirstCaps(boolean ignoreFirstCaps)
Ignore irregular capitalization on the first word. |
void |
setIgnoreIrregularCaps(boolean ignoreIrregularCaps)
When false, JSpell will flag an error if a word is at the beginning of a sentence but is not capitalized. |
void |
setIgnoreUpper(boolean ignoreUpper)
Sets the ignoreUpper variable. |
void |
setIgnoreWordsWithNumbers(boolean ignoreWordsWithNumbers)
Sets the ignoreWordsWithNumbers variable. |
void |
setLearnWords(boolean learnWords)
Can words be added to the dictionary. |
void |
setMaxSuggestions(int count)
Sets the maximum number of suggestions that the spell checker engine should return. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.wallstreetwise.app.jspell.domain.JSpellDictionaryAccessor |
|---|
close, open |
| Field Detail |
|---|
protected java.util.HashMap validWords
protected java.util.HashMap ignoreWords
protected java.lang.String nextWord
protected int batchSize
protected int batchCount
protected Suggestions suggestions
protected int maxSuggestions
protected JSpellErrorInfo currentError
protected boolean ignoreIrregularCaps
protected boolean dictionaryReady
protected boolean learnWords
protected boolean forceUpperCase
protected boolean ignoreFirstCaps
protected boolean ignoreUpper
protected boolean ignoreDoubleWords
protected boolean ignoreWordsWithNumbers
protected java.util.Vector errors
protected java.util.HashMap errorCache
| Constructor Detail |
|---|
public JSpellDictionary()
| Method Detail |
|---|
protected void init()
protected void setDictionaryReady(boolean newValue)
newValue - Is dictionary ready?public boolean getDictionaryReady()
getDictionaryReady in interface JSpellDictionaryAccessorpublic void setForceUpperCase(boolean forceUpperCase)
setForceUpperCase in interface JSpellDictionaryAccessorforceUpperCase - true or falsepublic boolean getForceUpperCase()
getForceUpperCase in interface JSpellDictionaryAccessorpublic void setLearnWords(boolean learnWords)
learnWords - true or falsepublic boolean getLearnWords()
getLearnWords in interface JSpellDictionaryAccessorpublic int getBatchSize()
getBatchSize in interface JSpellDictionaryAccessorpublic void setIgnoreIrregularCaps(boolean ignoreIrregularCaps)
setIgnoreIrregularCaps in interface JSpellDictionaryAccessorignoreIrregularCaps - true or falsepublic boolean getIgnoreIrregularCaps()
getIgnoreIrregularCaps in interface JSpellDictionaryAccessorpublic void setIgnoreFirstCaps(boolean ignoreFirstCaps)
setIgnoreFirstCaps in interface JSpellDictionaryAccessorignoreFirstCaps - true or falsepublic boolean getIgnoreFirstCaps()
getIgnoreFirstCaps in interface JSpellDictionaryAccessorpublic void setIgnoreUpper(boolean ignoreUpper)
setIgnoreUpper in interface JSpellDictionaryAccessorignoreUpper - true or falsepublic boolean getIgnoreUpper()
getIgnoreUpper in interface JSpellDictionaryAccessorpublic void setIgnoreDoubleWords(boolean ignoreDoubleWords)
setIgnoreDoubleWords in interface JSpellDictionaryAccessorignoreDoubleWords - true or falsepublic boolean getIgnoreDoubleWords()
getIgnoreDoubleWords in interface JSpellDictionaryAccessorpublic void setIgnoreWordsWithNumbers(boolean ignoreWordsWithNumbers)
setIgnoreWordsWithNumbers in interface JSpellDictionaryAccessorignoreWordsWithNumbers - true or falsepublic boolean getIgnoreWordsWithNumbers()
getIgnoreWordsWithNumbers in interface JSpellDictionaryAccessorpublic void setMaxSuggestions(int count)
count - number of suggestionspublic void setBatchSize(int batchSize)
setBatchSize in interface JSpellDictionaryAccessorbatchSize - number of words for each batchpublic void learnWord(java.lang.String word)
learnWord in interface JSpellDictionaryAccessorword - A string containing an individual word.public void learnWordManual(java.lang.String word)
learnWordManual in interface JSpellDictionaryAccessorword - A string containing an individual word.public void ignoreWord(java.lang.String word)
ignoreWord in interface JSpellDictionaryAccessorword - A string containing an individual word.public void resetAll()
resetAll in interface JSpellDictionaryAccessorpublic void resetErrors()
resetErrors in interface JSpellDictionaryAccessorpublic void adjustErrorPositions(int offset)
adjustErrorPositions in interface JSpellDictionaryAccessoroffset - The number of characters by which to adjust the remaining errors.
public JSpellErrorInfo getNextError()
throws java.lang.Exception
getNextError in interface JSpellDictionaryAccessorjava.lang.Exception - The exception that occurred during processing.public JSpellErrorInfo getCurrentError()
getCurrentError in interface JSpellDictionaryAccessor
public boolean checkWord(JSpellWordBundle word)
throws java.lang.Exception
checkWord in interface JSpellDictionaryAccessorword - A String containing an individual word.
java.lang.Exception - The Exception object when an error occurs.protected final void addFrequentWords()
public boolean checkCaps(char curChar,
char prevChar)
checkCaps in interface JSpellDictionaryAccessorcurChar - The current character.prevChar - The previous character.
public boolean checkCaps(char curChar,
char prevChar,
boolean hasDigits,
boolean capsFlag)
checkCaps in interface JSpellDictionaryAccessorcurChar - The current character.prevChar - The previous character.hasDigits - Word contains digits.capsFlag - Is caps checking enabled?
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||