|
RapidSpell Desktop |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the interface required for a class to be used as a checker engine.
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.
Method Summary | |
boolean |
addWord(java.lang.String word)
Adds a word to the user dictionary, if it exists. |
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. |
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. |
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. |
UserDictionary |
getUserDictionary()
Gets the user dictionary. |
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 |
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 |
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)
|
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 |
setWarnDuplicates(boolean value)
Whether to treat duplicate words as errors (eg. |
Method Detail |
public void check(java.lang.String text)
public BadWord nextBadWord()
Check must be called before this method.
public 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.
public void setIncludeUserDictionaryInSuggestions(boolean includeUserDictionaryInSuggestions)
public void setUserDictionary(UserDictionary userDictionary)
public void setUserDictionary(java.io.File userDictionary)
public boolean addWord(java.lang.String word)
Should return true if the word was added successfully, false otherwise.
public void setSuggestionsMethod(int method)
public int getSuggestionsMethod()
public void setIgnoreCapitalizedWords(boolean ignore)
public boolean getIgnoreXML()
public void setIgnoreXML(boolean v)
public boolean getIgnoreWordsWithDigits()
public void setIgnoreWordsWithDigits(boolean value)
public void setConsiderationRange(int range)
public void setSeparateHyphenWords(boolean separate)
public UserDictionary getUserDictionary()
public java.lang.String getDictFilePath()
public void setDictFilePath(java.lang.String s)
public int getLanguageParser()
Eg. If the dictionary is set to French, you should use the French parser.
LanguageType
public void setLanguageParser(int language)
Eg. If the dictionary is set to French, you should use the French parser.
language
- an int identifier from LanguageTypeLanguageType
public void setPosition(int pos)
Further calls to pos
.
If pos
> the text length it is set to the text length.
If pos
< 0, it is set to zero.
public boolean getIncludeUserDictionaryInSuggestions()
public boolean getIgnoreCapitalizedWords()
public int getConsiderationRange()
public void changeBadWord(java.lang.String newWord) throws NoCurrentBadWordException, java.lang.NullPointerException
newWord
in the text.newWord
- replaces the current misspelt word.public void ignoreAll(java.lang.String word)
word
to be ignored in rest of the text.public boolean getLookIntoHyphenatedText()
public void setLookIntoHyphenatedText(boolean value)
public void setMaximumAnagramLength(int maxAnagramLength)
public boolean getCheckCompoundWords()
public void setCheckCompoundWords(boolean value)
public boolean getSuggestSplitWords()
public void setSuggestSplitWords(boolean value)
public boolean getAllowMixedCase()
public void setAllowMixedCase(boolean value)
public boolean getAllowAnyCase()
public void setAllowAnyCase(boolean value)
public boolean getWarnDuplicates()
public void setWarnDuplicates(boolean value)
|
RapidSpell Desktop |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |