Then in your inherited class you can override our methods to make it behave how you wish, eg load the dictionary from your own source, or a database. Here is an empty implementation - class CUserDictionary extends com.keyoti.rapidSpell.UserDictionary { java.util.ArrayList wordList; boolean valid = true;
public CUserDictionary(){
} /** Tries to add word to this dictionary * @param word String containing the new word * @return true if added successfully, false otherwise. */ public boolean addWord(String word){ return true;
} /** Read the dictionary word list into list * @param list the String arraylist that the word list will be read into. * @return number of words in list. */ public int readAll(java.util.ArrayList list){ return 0; } /** Returns if the dictionary file is valid. */ public boolean isValid(){ return valid; } }
The RapidSpellChecker object is accessible through the UI components: RapidSpellGUI - rapidGUI.getCheckerEngine().setUserDictionary(new CUserDictionary()); RapidSpellAsYouType - rapidSpellAsYouType.getRapidSpellChecker().setUserDictionary(new CUserDictionary()); |