RapidSpell Web


com.keyoti.rapidSpell
Class UserDictionary

java.lang.Object
  extended by com.keyoti.rapidSpell.UserDictionary
Direct Known Subclasses:
CookieUserDictionary

public class UserDictionary
extends java.lang.Object

Represents the UserDictionary

Author:
Keyoti

Field Summary
 java.io.File dictFile
          The file containing the dictionary
 
Constructor Summary
UserDictionary()
           
UserDictionary(java.io.File userDictionaryFile)
          Construct a UserDictionary based on the userDictionaryFile, which does not have to exist.
UserDictionary(java.io.File userDictionaryFile, int wordLimit)
          Construct a UserDictionary based on the userDictionaryFile, which does not have to exist.
 
Method Summary
 boolean addWord(java.lang.String word)
          Tries to add word to this dictionary
 java.lang.String getEncoding()
          Gets the encoding to use
 boolean isValid()
          Returns if the dictionary file is valid.
 int readAll(java.util.ArrayList list)
          Read the dictionary word list into list
 void setEncoding(java.lang.String v)
          Sets the encoding to use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dictFile

public java.io.File dictFile
The file containing the dictionary

Constructor Detail

UserDictionary

public UserDictionary(java.io.File userDictionaryFile)
Construct a UserDictionary based on the userDictionaryFile, which does not have to exist.

User dictionary is limited to 5,000 words

Parameters:
userDictionaryFile - the file used for a user dictionary.

UserDictionary

public UserDictionary()

UserDictionary

public UserDictionary(java.io.File userDictionaryFile,
                      int wordLimit)
Construct a UserDictionary based on the userDictionaryFile, which does not have to exist.

Parameters:
listSize - number of words user dictionary is limited to (13,000 max). If wordLimit is <=0 it will be set to 13,000.
userDictionaryFile - the file used for a user dictionary.
Method Detail

getEncoding

public java.lang.String getEncoding()
Gets the encoding to use


setEncoding

public void setEncoding(java.lang.String v)
Sets the encoding to use


isValid

public boolean isValid()
Returns if the dictionary file is valid.


addWord

public boolean addWord(java.lang.String word)
Tries to add word to this dictionary

Parameters:
word - String containing the new word
Returns:
true if added successfully, false otherwise.

readAll

public int readAll(java.util.ArrayList list)
Read the dictionary word list into list

Parameters:
list - the String array that the word list will be read into.
Returns:
number of words in list.

RapidSpell Web


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