public abstract class CheckerEngineAdapter extends java.lang.Object implements ICheckerEngine
None of the members contained in this class do anything.
Constructor and Description |
---|
CheckerEngineAdapter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addWord(java.lang.String word)
Adds a word to the user dictionary, if it exists.
|
void |
changeBadWord(BadWord bw,
java.lang.String replacement) |
void |
changeBadWord(java.lang.String newWord)
Changes the current bad word to
newWord in the text. |
void |
check(java.lang.String text)
Checks the text for errors.
|
java.util.Vector |
findSuggestions()
Returns a Vector of Strings that are suitable suggestions for the current bad word (that is, the one last returned by nextBadWord()).
|
boolean |
getAllowMixedCase()
Whether to allow words spelt with mixed case, eg.
|
boolean |
getAnyMixedCase()
Whether to allow words spelt with any case, eg.
|
boolean |
getCheckCompoundWords()
Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.
|
int |
getConsiderationRange()
Gets the factor for words to consider for suggestions.
|
BadWord |
getCurrentBadWord()
The current BadWord, being iterated over.
|
java.lang.String |
getDictFilePath()
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.
|
boolean |
getIgnoreCapitalizedWords()
Gets whether to ignore words that start with capital letters.
|
java.util.Vector |
getIgnoreList() |
boolean |
getIgnoreURLsAndEmailAddresses()
Whether to ignore URLs and email addresses (requires V2Parser=true)
This will cause the following strings to be accepted as non-spelling errors;
"user@domain.com", "http://www.domain.com", "domain.co.uk" etc.
|
boolean |
getIgnoreXML()
Whether to ignore XML tags in the text.
|
boolean |
getIncludeUserDictionaryInSuggestions()
Gets whether the user dictionary should be used in finding suggestions for misspelt words.
|
int |
getLanguageParser()
Gets the type of language parsing to use.
|
boolean |
getLookIntoHyphenatedText()
Whether to 'look into' text with hyphens (-), if the word has hyphens in it and
LookIntoHyphenatedText is set true (default), the parts of the text around the hyphens will be checked individually.
|
int |
getSuggestionsMethod()
Gets the suggestions method, where method is an integer identifier.
|
boolean |
getSuggestSplitWords()
Whether to check for joined words when looking for suggestions.
|
RapidSpellChecker.State |
getUndoableStatePoint() |
UserDictionary |
getUserDictionary()
The user dictionary, this should be null if no user dictionary is being used.
|
boolean |
getV2Parser()
Whether to use parser version 2 - Set to false for backwards compatibility.
|
void |
ignoreAll(java.lang.String word)
Marks
word to be ignored in rest of the text. |
BadWord |
nextBadWord()
Gets the next bad word in the list that was identified by check.
|
void |
revertToUndoableStatePoint(RapidSpellChecker.State state) |
void |
setAllowMixedCase(boolean value)
Whether to allow words spelt with mixed case, eg.
|
void |
setAnyMixedCase(boolean value)
Whether to allow words spelt with any case, eg.
|
void |
setCheckCompoundWords(boolean value)
Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.
|
void |
setConsiderationRange(int range)
Sets the breadth of the suggestions search.
|
void |
setDictFilePath(java.lang.String value)
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.
|
void |
setIgnoreCapitalizedWords(boolean ignore)
Sets whether to ignore capitalized words.
|
void |
setIgnoreURLsAndEmailAddresses(boolean v)
Whether to ignore URLs and email addresses (requires V2Parser=true)
This will cause the following strings to be accepted as non-spelling errors;
"user@domain.com", "http://www.domain.com", "domain.co.uk" etc.
|
void |
setIgnoreXML(boolean b)
Whether to ignore XML tags in the text.
|
void |
setIncludeUserDictionaryInSuggestions(boolean includeUserDictionaryInSuggestions)
Sets whether to include the user dictionary in suggestions taken from this engine.
|
void |
setLanguageParser(int language)
The type of language parsing to use.
|
void |
setLookIntoHyphenatedText(boolean value)
Whether to 'look into' text with hyphens (-), if the word has hyphens in it and
LookIntoHyphenatedText is set true (default), the parts of the text around the hyphens will be checked individually.
|
void |
setPosition(int pos)
Sets the pointer position for the
nextBadWord iterator. |
void |
setSeparateHyphenWords(boolean separate)
Sets whether to separate words with hyphens in them into separate words.
|
void |
setSuggestionsMethod(int method)
Sets the suggestions method, where method is an integer identifier.
|
void |
setSuggestSplitWords(boolean value)
Whether to check for joined words when looking for suggestions.
|
void |
setUserDictionary(java.io.File userDictionary)
Sets the UserDictionary file path to be used as a user dictionary source.
|
void |
setUserDictionary(java.lang.String userDictionary)
Sets the UserDictionary file path to be used as a user dictionary source.
|
void |
setUserDictionary(UserDictionary userDictionary)
Sets the UserDictionary object to be used as a user dictionary source.
|
void |
setV2Parser(boolean v)
Whether to use parser version 2 - Set to false for backwards compatibility.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllowAnyCase, getIgnoreWordsWithDigits, getWarnDuplicates, setAllowAnyCase, setIgnoreWordsWithDigits, setMaximumAnagramLength, setWarnDuplicates
public void check(java.lang.String text)
check
in interface ICheckerEngine
java.lang.NullPointerException
- if text parameter is null.public BadWord nextBadWord()
Check must be called before this method.
nextBadWord
in interface ICheckerEngine
public java.util.Vector findSuggestions()
If no suggestions can be found, this should return an empty Vector. This method should be thread safe if operating with RapidSpell Desktop.
findSuggestions
in interface ICheckerEngine
public void setIncludeUserDictionaryInSuggestions(boolean includeUserDictionaryInSuggestions)
setIncludeUserDictionaryInSuggestions
in interface ICheckerEngine
public void setUserDictionary(UserDictionary userDictionary)
setUserDictionary
in interface ICheckerEngine
public void setUserDictionary(java.lang.String userDictionary)
public boolean addWord(java.lang.String word)
Should return true if the word was added successfully, false otherwise.
addWord
in interface ICheckerEngine
public void setSuggestionsMethod(int method)
setSuggestionsMethod
in interface ICheckerEngine
public int getSuggestionsMethod()
getSuggestionsMethod
in interface ICheckerEngine
public void setIgnoreCapitalizedWords(boolean ignore)
setIgnoreCapitalizedWords
in interface ICheckerEngine
public boolean getIgnoreXML()
getIgnoreXML
in interface ICheckerEngine
public void setIgnoreXML(boolean b)
setIgnoreXML
in interface ICheckerEngine
public void setConsiderationRange(int range)
setConsiderationRange
in interface ICheckerEngine
public void setSeparateHyphenWords(boolean separate)
setSeparateHyphenWords
in interface ICheckerEngine
public UserDictionary getUserDictionary()
getUserDictionary
in interface ICheckerEngine
public void setUserDictionary(java.io.File userDictionary)
setUserDictionary
in interface ICheckerEngine
public java.lang.String getDictFilePath()
getDictFilePath
in interface ICheckerEngine
public void setDictFilePath(java.lang.String value)
setDictFilePath
in interface ICheckerEngine
public int getLanguageParser()
getLanguageParser
in interface ICheckerEngine
LanguageType
public void setLanguageParser(int language)
Eg. If the dictionary is set to French, you should use the French parser.
setLanguageParser
in interface ICheckerEngine
language
- an int identifier from LanguageTypeLanguageType
public void setPosition(int pos)
nextBadWord
iterator.Further calls to nextBadWord
will look for the next bad word from position pos
.
If position > the text length it is set to the text length.
If position < 0, it is set to zero.
setPosition
in interface ICheckerEngine
public boolean getIncludeUserDictionaryInSuggestions()
getIncludeUserDictionaryInSuggestions
in interface ICheckerEngine
public boolean getIgnoreCapitalizedWords()
getIgnoreCapitalizedWords
in interface ICheckerEngine
public int getConsiderationRange()
getConsiderationRange
in interface ICheckerEngine
public void changeBadWord(java.lang.String newWord)
newWord
in the text.changeBadWord
in interface ICheckerEngine
newWord
- replaces the current misspelt word.public void ignoreAll(java.lang.String word)
word
to be ignored in rest of the text.ignoreAll
in interface ICheckerEngine
word
- to ignorepublic boolean getLookIntoHyphenatedText()
getLookIntoHyphenatedText
in interface ICheckerEngine
public void setLookIntoHyphenatedText(boolean value)
setLookIntoHyphenatedText
in interface ICheckerEngine
public boolean getCheckCompoundWords()
getCheckCompoundWords
in interface ICheckerEngine
public void setCheckCompoundWords(boolean value)
setCheckCompoundWords
in interface ICheckerEngine
public boolean getSuggestSplitWords()
getSuggestSplitWords
in interface ICheckerEngine
public void setSuggestSplitWords(boolean value)
setSuggestSplitWords
in interface ICheckerEngine
public boolean getAllowMixedCase()
getAllowMixedCase
in interface ICheckerEngine
public void setAllowMixedCase(boolean value)
setAllowMixedCase
in interface ICheckerEngine
public boolean getAnyMixedCase()
public void setAnyMixedCase(boolean value)
public RapidSpellChecker.State getUndoableStatePoint()
getUndoableStatePoint
in interface ICheckerEngine
public void revertToUndoableStatePoint(RapidSpellChecker.State state)
revertToUndoableStatePoint
in interface ICheckerEngine
public java.util.Vector getIgnoreList()
getIgnoreList
in interface ICheckerEngine
public void setIgnoreURLsAndEmailAddresses(boolean v)
ICheckerEngine
setIgnoreURLsAndEmailAddresses
in interface ICheckerEngine
public boolean getIgnoreURLsAndEmailAddresses()
ICheckerEngine
getIgnoreURLsAndEmailAddresses
in interface ICheckerEngine
public void setV2Parser(boolean v)
ICheckerEngine
setV2Parser
in interface ICheckerEngine
public boolean getV2Parser()
ICheckerEngine
getV2Parser
in interface ICheckerEngine
public void changeBadWord(BadWord bw, java.lang.String replacement)
changeBadWord
in interface ICheckerEngine
public BadWord getCurrentBadWord()
ICheckerEngine
getCurrentBadWord
in interface ICheckerEngine
Copyright © 2002-2016 Keyoti Inc. All Rights Reserved.