public class JSpellParser
extends java.lang.Object
Constructor and Description |
---|
JSpellParser()
Construct the JSpellParser object.
|
JSpellParser(JSpellDictionaryAccessor dictionary)
Construct parser using given JSpellDictionaryAccessor object.
|
JSpellParser(JSpellDictionaryAccessor dictionary,
java.lang.String textString)
Construct parser with the given JSpellDictionaryAccessor and set the text String
to check.
|
Modifier and Type | Method and Description |
---|---|
void |
addParserListener(ParserListener p)
Register a listener to be notified when the parsing and spellcheck is completed.
|
java.lang.StringBuffer |
autoCorrect()
Returns automatically corrected text.
|
void |
cancel()
Set the canceled flag to interrupt the spell checker.
|
boolean |
getCanceled()
Return the boolean indicating whether the spell checking is about to stop.
|
int |
getCurPos()
Get the current character position in the text.
|
JSpellDictionaryAccessor |
getDictionary()
Return the JSpellDictionaryAccessor object currently being used by this
JSpellParser.
|
JSpellErrorInfo |
getError()
Initiates validation of textToCheck and is also called repeatedly to
get errors from the JSpellDictionaryAccessor.
|
boolean |
getForceUpperCase()
See JSpellDictionary class for method description.
|
boolean |
getIgnoreDoubleWords()
Return value of ignoreDoubleWords.
|
boolean |
getIgnoreFirstCaps()
Return value of ignoreFirstCaps.
|
boolean |
getIgnoreIrregularCaps()
Return value of ignoreIrregularCaps.
|
boolean |
getIgnoreUpper()
Return value of ignoreUpper.
|
boolean |
getIgnoreWordsWithNumbers()
Return value of ignoreWordsWithNumbers.
|
boolean |
getLearnWords()
Does the underlying dictionary support addition of new words.
|
java.util.Vector |
getParserListeners()
Return the Vector of ParserListeners.
|
boolean |
getStopped()
Return the state of the spell checker, ie, is it stopped?
|
int |
getTextLength()
Get the length of the text to check.
|
java.lang.StringBuffer |
getTextStringBuffer()
Get the text being checked as a StringBuffer.
|
void |
ignoreWord(java.lang.String word)
Add this word to the list of words to ignore in the dictionary accessor.
|
void |
learnWord(JSpellErrorInfo errorInfo)
Add this word to the dictionary.
|
void |
notifyListeners()
Notify the parser listeners that the parsing and spell check is complete.
|
void |
replaceAll(JSpellErrorInfo errorInfo,
java.lang.String repl)
Replace all instances of 'orig' word with 'repl' word.
|
void |
replaceSingle(JSpellErrorInfo errorInfo,
java.lang.String repl)
Replace single instance of 'orig' word with 'repl' word.
|
void |
reset()
Reset the pending errors.
|
void |
resetAll()
Reset the pending errors, alternate method.
|
void |
setCurPos(int curPos)
Set the current position in the text being checked.
|
void |
setDictionary(JSpellDictionaryAccessor dictionary)
Initialize the JSpellParser with the given JSpellDictionaryAccessor object.
|
void |
setForceUpperCase(boolean forceUpperCase)
See JSpellDictionary class for method description.
|
void |
setIgnoreDoubleWords(boolean bValue)
To not check duplicated words (such as 'the the'), set this value to true,
otherwise, repeated words will be returned as an error by the parser.
|
void |
setIgnoreFirstCaps(boolean bValue)
To ignore irregular capitalization of the first word being checked, set
this value to true, otherwise the first word being checked should be capitalized.
|
void |
setIgnoreIrregularCaps(boolean bValue)
To ignore irregular capitalization, set this value to true, otherwise,
words that are irregularly capitalized will be flagged as errors.
|
void |
setIgnoreUpper(boolean bValue)
To not check words in all upper case, set this value to true, otherwise,
words in upper case will be checked in the same manner as lowercase words.
|
void |
setIgnoreWordsWithNumbers(boolean bValue)
To not check words with embedded numbers, set this value to true, otherwise,
words with embedded numbers will be checked in the same manner as other words.
|
void |
setPauseNotif(boolean pauseNotif)
Pause ParserListener notification.
|
void |
setTextString(java.lang.String textString)
Pass a string of text to check to the parser.
|
void |
stopped()
Stop the spell checker.
|
public JSpellParser()
public JSpellParser(JSpellDictionaryAccessor dictionary)
dictionary
- a JSpellDictionaryAccessor object.public JSpellParser(JSpellDictionaryAccessor dictionary, java.lang.String textString)
dictionary
- a JSpellDictionaryAccessor object.textString
- a String.public final boolean getForceUpperCase()
public final void setForceUpperCase(boolean forceUpperCase)
forceUpperCase
- true or falsepublic final void setDictionary(JSpellDictionaryAccessor dictionary)
dictionary
- a JSpellDictionaryAccessor object.public void stopped()
public boolean getStopped()
public final JSpellDictionaryAccessor getDictionary()
public final void setTextString(java.lang.String textString)
textString
- a String.public final void addParserListener(ParserListener p)
p
- a ParserListener.public final java.lang.StringBuffer autoCorrect() throws java.lang.Exception
java.lang.Exception
- an Exception object.public final JSpellErrorInfo getError() throws java.lang.Exception
java.lang.Exception
- an Exception object.public java.util.Vector getParserListeners()
public final void notifyListeners()
public final void cancel()
public final boolean getCanceled()
public final void reset()
public final void resetAll()
public final void learnWord(JSpellErrorInfo errorInfo)
errorInfo
- a JSpellErrorInfo object.public final boolean getLearnWords()
public final void ignoreWord(java.lang.String word)
word
- a String.public final void replaceSingle(JSpellErrorInfo errorInfo, java.lang.String repl)
errorInfo
- a JSpellErrorInfo object representing the word to replace.repl
- a String representing the replacement word.public final void replaceAll(JSpellErrorInfo errorInfo, java.lang.String repl)
errorInfo
- A JSpellErrorInfo object representing the word to replace.repl
- a String representing the replacement word.public final int getCurPos()
public final void setCurPos(int curPos)
curPos
- an int.public final int getTextLength()
public final java.lang.StringBuffer getTextStringBuffer()
public final void setIgnoreIrregularCaps(boolean bValue)
bValue
- true or falsepublic final void setIgnoreWordsWithNumbers(boolean bValue)
bValue
- true or falsepublic final void setIgnoreDoubleWords(boolean bValue)
bValue
- true or falsepublic final void setIgnoreFirstCaps(boolean bValue)
bValue
- true or falsepublic final void setIgnoreUpper(boolean bValue)
bValue
- true or falsepublic final boolean getIgnoreIrregularCaps()
public final boolean getIgnoreWordsWithNumbers()
public final boolean getIgnoreDoubleWords()
public final boolean getIgnoreFirstCaps()
public final boolean getIgnoreUpper()
public final void setPauseNotif(boolean pauseNotif)
pauseNotif
- true or false.JSpell SDK - Spell Checker for the Java Platform
Copyright © 2009-2019 Page Scholar Inc, All Rights Reserved - https://www.jspell.com