Knowledgebase Home Page  >  RapidSpell Desktop Java
Search the Knowledge Base
How can I customize the way the user dictionary works, or is loaded? How can I load the user dictionary from a database? (RapidSpell Desktop Java)
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=119&catId=46

Options

Print this page
Email this to a friend
You are free to subclass the com.keyoti.rapidSpell.UserDictionary class http://keyoti.com/products/rapidspell/javaweb/api/com/keyoti/rapidSpell/UserDictionary.html
 
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;
  }

 }
 
This class should then be set through the setUserDictionary(UserDictionary d) method in RapidSpellChecker http://keyoti.com/products/rapidspell/javaweb/api/com/keyoti/rapidSpell/RapidSpellChecker.html#setUserDictionary(com.keyoti.rapidSpell.UserDictionary).
 
 
The RapidSpellChecker object is accessible through the UI components:
 
RapidSpellGUI  - 
rapidGUI.getCheckerEngine().setUserDictionary(new CUserDictionary());
 
RapidSpellAsYouType -
rapidSpellAsYouType.getRapidSpellChecker().setUserDictionary(new CUserDictionary());

Related Questions:

Attachments:

No attachments were found.