RapidSpell Web


com.keyoti.rapidSpell
Interface ICheckerEngine

All Known Implementing Classes:
CheckerEngineAdapter, RapidSpellChecker

public interface ICheckerEngine

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.

Since:
v2.0.0

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)
          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 setWarnDuplicates(boolean value)
          Whether to treat duplicate words as errors (eg.
 

Method Detail

check

void check(java.lang.String text)
Checks the text for errors.

Throws:
java.lang.NullPointerException - if text parameter is null.

nextBadWord

BadWord nextBadWord()
Gets the next bad word in the list that was identified by Check.

Check must be called before this method.

Returns:
The next BadWord object from the text, must return null when no more bad words exist.

findSuggestions

java.util.Vector findSuggestions()
                                 throws NoCurrentBadWordException,
                                        java.lang.NullPointerException
Returns a Vector of Strings that are suitable suggestions for the current bad word (that is, the one last returned by nextBadWord()).

If no suggestions can be found, this should return an empty Vector. This method must be thread safe if operating with RapidSpell Desktop.

Throws:
NoCurrentBadWordException - If nextBadWord() hasn't been run first AND found an erroneous word.
java.lang.NullPointerException

setIncludeUserDictionaryInSuggestions

void setIncludeUserDictionaryInSuggestions(boolean includeUserDictionaryInSuggestions)
Sets whether to include the user dictionary in suggestions taken from this engine.


setUserDictionary

void setUserDictionary(UserDictionary userDictionary)
Sets the UserDictionary object to be used as a user dictionary source.


setUserDictionary

void setUserDictionary(java.io.File userDictionary)
Sets the UserDictionary file path to be used as a user dictionary source.


addWord

boolean addWord(java.lang.String word)
Adds a word to the user dictionary, if it exists.

Should return true if the word was added successfully, false otherwise.


setSuggestionsMethod

void setSuggestionsMethod(int method)
If supported, sets the suggestions method, where method is an integer identifier.


getSuggestionsMethod

int getSuggestionsMethod()
If supported, sets the suggestions method, where method is an integer identifier.


setIgnoreCapitalizedWords

void setIgnoreCapitalizedWords(boolean ignore)
If supported, sets whether to ignore capitalized words.


getIgnoreXML

boolean getIgnoreXML()
If supported, gets whether to ignore XML tags in the text.


setIgnoreXML

void setIgnoreXML(boolean v)
If supported, sets whether to ignore XML tags in the text.


getIgnoreWordsWithDigits

boolean getIgnoreWordsWithDigits()
Whether to ignore words with digits in them.


setIgnoreWordsWithDigits

void setIgnoreWordsWithDigits(boolean value)
Whether to ignore words with digits in them.


setConsiderationRange

void setConsiderationRange(int range)
If supported, sets the breadth of the suggestions search.


setSeparateHyphenWords

void setSeparateHyphenWords(boolean separate)
If supported, sets whether to separate words with hyphens in them into separate words.


getUserDictionary

UserDictionary getUserDictionary()
Gets the user dictionary.


getDictFilePath

java.lang.String getDictFilePath()
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.


setDictFilePath

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.


getLanguageParser

int getLanguageParser()
The type of language parsing to use.

Eg. If the dictionary is set to French, you should use the French parser.

Returns:
int identifier from LanguageType
See Also:
LanguageType

setLanguageParser

void setLanguageParser(int language)
The type of language parsing to use.

Eg. If the dictionary is set to French, you should use the French parser.

Parameters:
language - an int identifier from LanguageType
See Also:
LanguageType

setPosition

void setPosition(int pos)
Sets the pointer position for the nextBadWord iterator.

Further calls to nextBadWord will look for the next bad word from position pos.

If pos > the text length it is set to the text length.

If pos < 0, it is set to zero.


getIncludeUserDictionaryInSuggestions

boolean getIncludeUserDictionaryInSuggestions()
If supported, gets whether the user dictionary should be used in finding suggestions for misspelt words.


getIgnoreCapitalizedWords

boolean getIgnoreCapitalizedWords()
If supported, gets whether to ignore words that start with capital letters.


getConsiderationRange

int getConsiderationRange()
Gets the factor for words to consider for suggestions.


changeBadWord

void changeBadWord(java.lang.String newWord)
                   throws NoCurrentBadWordException,
                          java.lang.NullPointerException
Changes the current bad word to newWord in the text.

Parameters:
newWord - replaces the current misspelt word.
Throws:
NoCurrentBadWordException - if nextBadWord() hasn't been run first AND found an erroneous word.
java.lang.NullPointerException - if newWord parameter is null.

ignoreAll

void ignoreAll(java.lang.String word)
Marks word to be ignored in rest of the text.


getLookIntoHyphenatedText

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. Eg. "socio-economic" will be checked as "socio" and "economic".


setLookIntoHyphenatedText

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. Eg. "socio-economic" will be checked as "socio" and "economic".


setMaximumAnagramLength

void setMaximumAnagramLength(int maxAnagramLength)
If supported, sets the longest word length to find anagrams for. Default is 8. Increasing this will slow down suggestion look ups. Note RapidSpell Desktop and RapidSpell Web interface classes set this to their own values.


getCheckCompoundWords

boolean getCheckCompoundWords()
Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.


setCheckCompoundWords

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.


getSuggestSplitWords

boolean getSuggestSplitWords()
Whether to check for joined words when looking for suggestions.


setSuggestSplitWords

void setSuggestSplitWords(boolean value)
Whether to check for joined words when looking for suggestions.


getAllowMixedCase

boolean getAllowMixedCase()
Whether to allow words spelt with mixed case, eg. "MIxEd".


setAllowMixedCase

void setAllowMixedCase(boolean value)
Whether to allow words spelt with mixed case, eg. "MIxEd".


getAllowAnyCase

boolean getAllowAnyCase()
Whether to allow words spelt with any case, eg. "africa".


setAllowAnyCase

void setAllowAnyCase(boolean value)
Whether to allow words spelt with any case, eg. "africa".


getWarnDuplicates

boolean getWarnDuplicates()
Whether to treat duplicate words as errors (eg. "this is is an error").


setWarnDuplicates

void setWarnDuplicates(boolean value)
Whether to treat duplicate words as errors (eg. "this is is an error").


RapidSpell Web


Copyright © 2002-2013 Keyoti Inc. All Rights Reserved.