RapidSpell Desktop


com.keyoti.rapidSpell
Class CheckerEngineAdapter

java.lang.Object
  |
  +--com.keyoti.rapidSpell.CheckerEngineAdapter

public abstract class CheckerEngineAdapter
extends java.lang.Object
implements ICheckerEngine

Abstract base implementation of ICheckerEngine, override chosen members for desired functionality.

None of the members contained in this class do anything.

Since:
v2.0.0

Constructor Summary
CheckerEngineAdapter()
          Default constructor.
 
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 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.
 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.
 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.
 UserDictionary getUserDictionary()
          The user dictionary, this should be null if no user dictionary is being used.
 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 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckerEngineAdapter

public CheckerEngineAdapter()
Default constructor.
Method Detail

check

public void check(java.lang.String text)
Checks the text for errors.
Specified by:
check in interface ICheckerEngine
Throws:
java.lang.NullPointerException - if text parameter is null.

nextBadWord

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

Check must be called before this method.

Specified by:
nextBadWord in interface ICheckerEngine
Returns:
This implementation always returns null.

findSuggestions

public 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()).

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

Specified by:
findSuggestions in interface ICheckerEngine
Returns:
An empty Vector.

setIncludeUserDictionaryInSuggestions

public void setIncludeUserDictionaryInSuggestions(boolean includeUserDictionaryInSuggestions)
Sets whether to include the user dictionary in suggestions taken from this engine.
Specified by:
setIncludeUserDictionaryInSuggestions in interface ICheckerEngine

setUserDictionary

public void setUserDictionary(UserDictionary userDictionary)
Sets the UserDictionary object to be used as a user dictionary source.
Specified by:
setUserDictionary in interface ICheckerEngine

setUserDictionary

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

addWord

public 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.

Specified by:
addWord in interface ICheckerEngine
Returns:
This implementation always returns false.

setSuggestionsMethod

public void setSuggestionsMethod(int method)
Sets the suggestions method, where method is an integer identifier.
Specified by:
setSuggestionsMethod in interface ICheckerEngine

getSuggestionsMethod

public int getSuggestionsMethod()
Gets the suggestions method, where method is an integer identifier. This implementation always returns 0.
Specified by:
getSuggestionsMethod in interface ICheckerEngine

setIgnoreCapitalizedWords

public void setIgnoreCapitalizedWords(boolean ignore)
Sets whether to ignore capitalized words.
Specified by:
setIgnoreCapitalizedWords in interface ICheckerEngine

getIgnoreXML

public boolean getIgnoreXML()
Whether to ignore XML tags in the text.
Specified by:
getIgnoreXML in interface ICheckerEngine
Returns:
This property is always false.

setIgnoreXML

public void setIgnoreXML(boolean b)
Whether to ignore XML tags in the text.
Specified by:
setIgnoreXML in interface ICheckerEngine

setConsiderationRange

public void setConsiderationRange(int range)
Sets the breadth of the suggestions search.
Specified by:
setConsiderationRange in interface ICheckerEngine

setSeparateHyphenWords

public void setSeparateHyphenWords(boolean separate)
Sets whether to separate words with hyphens in them into separate words.
Specified by:
setSeparateHyphenWords in interface ICheckerEngine

getUserDictionary

public UserDictionary getUserDictionary()
The user dictionary, this should be null if no user dictionary is being used.
Specified by:
getUserDictionary in interface ICheckerEngine
Returns:
This implementation always returns null.

setUserDictionary

public void setUserDictionary(java.io.File userDictionary)
Sets the UserDictionary file path to be used as a user dictionary source.
Specified by:
setUserDictionary in interface ICheckerEngine

getDictFilePath

public java.lang.String getDictFilePath()
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.
Specified by:
getDictFilePath in interface ICheckerEngine

setDictFilePath

public 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.
Specified by:
setDictFilePath in interface ICheckerEngine

getLanguageParser

public int getLanguageParser()
Gets the type of language parsing to use.

Specified by:
getLanguageParser in interface ICheckerEngine
Returns:
LanguageType.ENGLISH
See Also:
LanguageType

setLanguageParser

public 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.

Specified by:
setLanguageParser in interface ICheckerEngine
See Also:
LanguageType

setPosition

public 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 position > the text length it is set to the text length. If position < 0, it is set to zero.

Specified by:
setPosition in interface ICheckerEngine

getIncludeUserDictionaryInSuggestions

public boolean getIncludeUserDictionaryInSuggestions()
Gets whether the user dictionary should be used in finding suggestions for misspelt words.
Specified by:
getIncludeUserDictionaryInSuggestions in interface ICheckerEngine
Returns:
This implementation always returns false.

getIgnoreCapitalizedWords

public boolean getIgnoreCapitalizedWords()
Gets whether to ignore words that start with capital letters.
Specified by:
getIgnoreCapitalizedWords in interface ICheckerEngine
Returns:
This implementation always returns false.

getConsiderationRange

public int getConsiderationRange()
Gets the factor for words to consider for suggestions.
Specified by:
getConsiderationRange in interface ICheckerEngine
Returns:
This implementation always returns 0.

changeBadWord

public void changeBadWord(java.lang.String newWord)
Changes the current bad word to newWord in the text.
Specified by:
changeBadWord in interface ICheckerEngine
Parameters:
newWord - replaces the current misspelt word.

ignoreAll

public void ignoreAll(java.lang.String word)
Marks word to be ignored in rest of the text.
Specified by:
ignoreAll in interface ICheckerEngine
Parameters:
word - to ignore

getLookIntoHyphenatedText

public 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. Eg. "socio-economic" will be checked as "socio" and "economic".
Specified by:
getLookIntoHyphenatedText in interface ICheckerEngine
Returns:
false

setLookIntoHyphenatedText

public 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. Eg. "socio-economic" will be checked as "socio" and "economic".
Specified by:
setLookIntoHyphenatedText in interface ICheckerEngine

getCheckCompoundWords

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

setCheckCompoundWords

public 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.
Specified by:
setCheckCompoundWords in interface ICheckerEngine

getSuggestSplitWords

public boolean getSuggestSplitWords()
Whether to check for joined words when looking for suggestions.
Specified by:
getSuggestSplitWords in interface ICheckerEngine

setSuggestSplitWords

public void setSuggestSplitWords(boolean value)
Whether to check for joined words when looking for suggestions.
Specified by:
setSuggestSplitWords in interface ICheckerEngine

getAllowMixedCase

public boolean getAllowMixedCase()
Whether to allow words spelt with mixed case, eg. "MIxEd".
Specified by:
getAllowMixedCase in interface ICheckerEngine

setAllowMixedCase

public void setAllowMixedCase(boolean value)
Whether to allow words spelt with mixed case, eg. "MIxEd".
Specified by:
setAllowMixedCase in interface ICheckerEngine

getAnyMixedCase

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

setAnyMixedCase

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

RapidSpell Desktop


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