public interface ICheckerEngine
This is the interface which any checker engine must have, by implementing this interface any object can be used to parse text and identify 'bad words'.
It is not necessary to functionally implement all members, for this reason an abstract empty implementation class is provided (CheckerEngineAdapter) which can be extended and overridden for desired functionality.
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 badWord,
java.lang.String newWord) |
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 |
getAllowAnyCase()
Whether to allow words spelt with any case, eg.
|
boolean |
getAllowMixedCase()
Whether to allow words spelt with mixed 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()
If supported, 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 |
getIgnoreWordsWithDigits()
Whether to ignore words with digits in them.
|
boolean |
getIgnoreXML()
If supported, gets whether to ignore XML tags in the text.
|
boolean |
getIncludeUserDictionaryInSuggestions()
If supported, gets whether the user dictionary should be used in finding suggestions for misspelt words.
|
int |
getLanguageParser()
The type of language parsing to use.
|
boolean |
getLookIntoHyphenatedText()
If supported, 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()
If supported, sets 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()
Gets the user dictionary.
|
boolean |
getV2Parser()
Whether to use parser version 2 - Set to false for backwards compatibility.
|
boolean |
getWarnDuplicates()
Whether to treat duplicate words as errors (eg.
|
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 |
setAllowAnyCase(boolean value)
Whether to allow words spelt with any case, eg.
|
void |
setAllowMixedCase(boolean value)
Whether to allow words spelt with mixed 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)
If supported, sets the breadth of the suggestions search.
|
void |
setDictFilePath(java.lang.String s)
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.
|
void |
setIgnoreCapitalizedWords(boolean ignore)
If supported, sets whether to ignore capitalized words.
|
void |
setIgnoreURLsAndEmailAddresses(boolean value)
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 |
setIgnoreWordsWithDigits(boolean value)
Whether to ignore words with digits in them.
|
void |
setIgnoreXML(boolean v)
If supported, sets 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)
If supported, 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 |
setMaximumAnagramLength(int maxAnagramLength)
If supported, sets the longest word length to find anagrams for.
|
void |
setPosition(int pos)
Sets the pointer position for the nextBadWord iterator.
|
void |
setSeparateHyphenWords(boolean separate)
If supported, sets whether to separate words with hyphens in them into separate words.
|
void |
setSuggestionsMethod(int method)
If supported, 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(UserDictionary userDictionary)
Sets the UserDictionary object to be used as a user dictionary source.
|
void |
setV2Parser(boolean value)
Whether to use parser version 2 - Set to false for backwards compatibility.
|
void |
setWarnDuplicates(boolean value)
Whether to treat duplicate words as errors (eg.
|
void check(java.lang.String text)
java.lang.NullPointerException
- if text parameter is null.BadWord nextBadWord()
Check must be called before this method.
BadWord getCurrentBadWord()
RapidSpellChecker.State getUndoableStatePoint()
void revertToUndoableStatePoint(RapidSpellChecker.State state)
java.util.Vector getIgnoreList()
java.util.Vector findSuggestions() throws NoCurrentBadWordException, java.lang.NullPointerException
nextBadWord()
).
If no suggestions can be found, this should return an empty Vector. This method must be thread safe if operating with RapidSpell Desktop.
NoCurrentBadWordException
- If nextBadWord() hasn't been run first AND found an erroneous word.java.lang.NullPointerException
void setIncludeUserDictionaryInSuggestions(boolean includeUserDictionaryInSuggestions)
void setUserDictionary(UserDictionary userDictionary)
void setUserDictionary(java.io.File userDictionary)
boolean addWord(java.lang.String word)
Should return true if the word was added successfully, false otherwise.
void setSuggestionsMethod(int method)
int getSuggestionsMethod()
void setIgnoreCapitalizedWords(boolean ignore)
boolean getIgnoreXML()
void setIgnoreXML(boolean v)
boolean getIgnoreWordsWithDigits()
void setIgnoreWordsWithDigits(boolean value)
void setConsiderationRange(int range)
void setSeparateHyphenWords(boolean separate)
UserDictionary getUserDictionary()
java.lang.String getDictFilePath()
void setDictFilePath(java.lang.String s)
int getLanguageParser()
Eg. If the dictionary is set to French, you should use the French parser.
LanguageType
void setLanguageParser(int language)
Eg. If the dictionary is set to French, you should use the French parser.
language
- an int identifier from LanguageTypeLanguageType
void setPosition(int pos)
pos
.
If pos
> the text length it is set to the text length.
If pos
< 0, it is set to zero.boolean getIncludeUserDictionaryInSuggestions()
boolean getIgnoreCapitalizedWords()
int getConsiderationRange()
void changeBadWord(java.lang.String newWord) throws NoCurrentBadWordException, java.lang.NullPointerException
newWord
in the text.newWord
- replaces the current misspelt word.NoCurrentBadWordException
- if nextBadWord() hasn't been run first AND found an erroneous word.java.lang.NullPointerException
- if newWord parameter is null.void changeBadWord(BadWord badWord, java.lang.String newWord) throws java.lang.NullPointerException
java.lang.NullPointerException
void ignoreAll(java.lang.String word)
word
to be ignored in rest of the text.boolean getLookIntoHyphenatedText()
void setLookIntoHyphenatedText(boolean value)
void setMaximumAnagramLength(int maxAnagramLength)
boolean getCheckCompoundWords()
void setCheckCompoundWords(boolean value)
boolean getSuggestSplitWords()
void setSuggestSplitWords(boolean value)
boolean getAllowMixedCase()
void setAllowMixedCase(boolean value)
boolean getAllowAnyCase()
void setAllowAnyCase(boolean value)
boolean getWarnDuplicates()
void setWarnDuplicates(boolean value)
boolean getV2Parser()
void setV2Parser(boolean value)
boolean getIgnoreURLsAndEmailAddresses()
void setIgnoreURLsAndEmailAddresses(boolean value)
Copyright © 2002-2016 Keyoti Inc. All Rights Reserved.