com.wallstreetwise.app.jspell.domain
Class JSpellDictionaryManager

java.lang.Object
  extended by com.wallstreetwise.app.jspell.domain.JSpellDictionaryManager

public class JSpellDictionaryManager
extends java.lang.Object

This classes manages a collection of dictionaries for use by JSpell. This class is implemented as a singleton, meaning only one instance of this class may exist per virtual machine. To construct an instance of this class you must supply a parameter specifying the location of the JSpell dictionaries. JSpell dictionaries are identified by the extension .jdx. Dictionaries that are compatible with JSpell 2004 start with lex_.

Author:
clifford_admin

Field Summary
protected  boolean forceUpperCase
          See JSpellDictionary documentation.
protected  boolean ignoreDoubleWords
          See JSpellDictionary documentation.
protected  boolean ignoreFirstCaps
          See JSpellDictionary documentation.
protected  boolean ignoreIrregularCaps
          See JSpellDictionary documentation.
protected  boolean ignoreUpper
          See JSpellDictionary documentation.
protected  boolean ignoreWordsWithNumbers
          See JSpellDictionary documentation.
 
Method Summary
 java.util.HashMap getBlockList()
          A HashMap containing words to filter or replace.
 java.lang.String getDictionaryDirectory()
          Returns the directory where the JSpell dictionary files are located.
 JSpellDictionaryLocal getJSpellDictionaryLocal(java.lang.String description)
          Retrieve a JSpellDictionaryLocal object from the manager using the description containing the language and country code to determine which dictionary object to return.
 JSpellDictionaryLocal getJSpellDictionaryLocal(java.lang.String language, java.lang.String country, java.lang.String version)
          Retrieve a JSpellDictionaryLocal object from the manager using the language and country to determine which dictionary object to return.
static JSpellDictionaryManager getJSpellDictionaryManager()
          Returns an instance of the JSpellDictionaryManager object.
 java.util.Vector getLanguages()
          Returns a Vector containing String descriptions of the languages and country codes that this JSpellDictionaryManager is managing.
 boolean isForceUpperCase()
          Getter for property forceUpperCase.
 boolean isIgnoreDoubleWords()
          Getter for property ignoreDoubleWords.
 boolean isIgnoreFirstCaps()
          Getter for property ignoreFirstCaps.
 boolean isIgnoreIrregularCaps()
          Getter for property ignoreIrregularCaps.
 boolean isIgnoreUpper()
          Getter for property ignoreUpper.
 boolean isIgnoreWordsWithNumbers()
          Getter for property ignoreWordsWithNumbers.
 boolean setDictionaryDirectory(java.lang.String dictionaryDirectory)
          Setter for property dictionaryDirectory.
 void setForceUpperCase(boolean forceUpperCase)
          Setter for property forceUpperCase.
 void setIgnoreDoubleWords(boolean ignoreDoubleWords)
          Setter for property ignoreDoubleWords.
 void setIgnoreFirstCaps(boolean ignoreFirstCaps)
          Setter for property ignoreFirstCaps.
 void setIgnoreIrregularCaps(boolean ignoreIrregularCaps)
          Setter for property ignoreIrregularCaps.
 void setIgnoreUpper(boolean ignoreUpper)
          Setter for property ignoreUpper.
 void setIgnoreWordsWithNumbers(boolean ignoreWordsWithNumbers)
          Setter for property ignoreWordsWithNumbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ignoreIrregularCaps

protected boolean ignoreIrregularCaps
See JSpellDictionary documentation.


forceUpperCase

protected boolean forceUpperCase
See JSpellDictionary documentation.


ignoreFirstCaps

protected boolean ignoreFirstCaps
See JSpellDictionary documentation.


ignoreUpper

protected boolean ignoreUpper
See JSpellDictionary documentation.


ignoreDoubleWords

protected boolean ignoreDoubleWords
See JSpellDictionary documentation.


ignoreWordsWithNumbers

protected boolean ignoreWordsWithNumbers
See JSpellDictionary documentation.

Method Detail

getJSpellDictionaryManager

public static JSpellDictionaryManager getJSpellDictionaryManager()
Returns an instance of the JSpellDictionaryManager object. This class is implemented as a singleton. Multiple calls to this method will return the same object.

Returns:
a JSpellDictionaryManager object.

getJSpellDictionaryLocal

public JSpellDictionaryLocal getJSpellDictionaryLocal(java.lang.String language,
                                                      java.lang.String country,
                                                      java.lang.String version)
Retrieve a JSpellDictionaryLocal object from the manager using the language and country to determine which dictionary object to return.

Parameters:
language - ISO language code.
country - ISO country code.
Returns:
a JSpellDictionaryLocal object.

getJSpellDictionaryLocal

public JSpellDictionaryLocal getJSpellDictionaryLocal(java.lang.String description)
Retrieve a JSpellDictionaryLocal object from the manager using the description containing the language and country code to determine which dictionary object to return.

Parameters:
description - a String description of the dictionary, e.g., "English (US)" or "Spanish (ES)"
Returns:
a JSpellDictionaryLocal object.

getLanguages

public java.util.Vector getLanguages()
Returns a Vector containing String descriptions of the languages and country codes that this JSpellDictionaryManager is managing. These descriptions may be passed to the getJSpellDictionaryLocal method to retrieve a specific dictionary object for a given language and country.

Returns:
a Vector of String language and country descriptions.

getDictionaryDirectory

public java.lang.String getDictionaryDirectory()
Returns the directory where the JSpell dictionary files are located.

Returns:
a String containing a path to a directory.

setDictionaryDirectory

public boolean setDictionaryDirectory(java.lang.String dictionaryDirectory)
Setter for property dictionaryDirectory. Looks in specified directory for JSpell dictionaries and makes them available via the JSpellDictionaryManager. Once the dictionaries are loaded, call getJSpellDictionaryLocal with the language and country code to obtain a dictionary. You may place a file called 'lexicon.lst' into the directory containing JSpell dictionaries in order to specify which lexicons to use, as well as to specify the order in which they should appear in GUI elements that use the JSpellDictionaryManager.getLanguages method.

Parameters:
dictionaryDirectory - New value of property dictionaryDirectory.
Returns:
Returns true or false if the dictionary directory was set with a valid directory.

getBlockList

public java.util.HashMap getBlockList()
A HashMap containing words to filter or replace. This HashMap is populated by making entries into the block.lst file which is contained within the same directory as the JSpell dictionary files.

Returns:
a HashMap with original words as keys and replacement words as values.

isForceUpperCase

public boolean isForceUpperCase()
Getter for property forceUpperCase.

Returns:
Value of property forceUpperCase.

setForceUpperCase

public void setForceUpperCase(boolean forceUpperCase)
Setter for property forceUpperCase. Propagates the setting to all the dictionaries managed by the JSpellDictionaryManager.

Parameters:
forceUpperCase - New value of property forceUpperCase.

isIgnoreDoubleWords

public boolean isIgnoreDoubleWords()
Getter for property ignoreDoubleWords.

Returns:
Value of property ignoreDoubleWords.

setIgnoreDoubleWords

public void setIgnoreDoubleWords(boolean ignoreDoubleWords)
Setter for property ignoreDoubleWords. Propagates the setting to all the dictionaries managed by the JSpellDictionaryManager.

Parameters:
ignoreDoubleWords - New value of property ignoreDoubleWords.

isIgnoreFirstCaps

public boolean isIgnoreFirstCaps()
Getter for property ignoreFirstCaps.

Returns:
Value of property ignoreFirstCaps.

setIgnoreFirstCaps

public void setIgnoreFirstCaps(boolean ignoreFirstCaps)
Setter for property ignoreFirstCaps. Propagates the setting to all the dictionaries managed by the JSpellDictionaryManager.

Parameters:
ignoreFirstCaps - New value of property ignoreFirstCaps.

isIgnoreIrregularCaps

public boolean isIgnoreIrregularCaps()
Getter for property ignoreIrregularCaps.

Returns:
Value of property ignoreIrregularCaps.

setIgnoreIrregularCaps

public void setIgnoreIrregularCaps(boolean ignoreIrregularCaps)
Setter for property ignoreIrregularCaps. Propagates the setting to all the dictionaries managed by the JSpellDictionaryManager.

Parameters:
ignoreIrregularCaps - New value of property ignoreIrregularCaps.

isIgnoreUpper

public boolean isIgnoreUpper()
Getter for property ignoreUpper.

Returns:
Value of property ignoreUpper.

setIgnoreUpper

public void setIgnoreUpper(boolean ignoreUpper)
Setter for property ignoreUpper. Propagates the setting to all the dictionaries managed by the JSpellDictionaryManager.

Parameters:
ignoreUpper - New value of property ignoreUpper.

isIgnoreWordsWithNumbers

public boolean isIgnoreWordsWithNumbers()
Getter for property ignoreWordsWithNumbers.

Returns:
Value of property ignoreWordsWithNumbers.

setIgnoreWordsWithNumbers

public void setIgnoreWordsWithNumbers(boolean ignoreWordsWithNumbers)
Setter for property ignoreWordsWithNumbers. Propagates the setting to all the dictionaries managed by the JSpellDictionaryManager.

Parameters:
ignoreWordsWithNumbers - New value of property ignoreWordsWithNumbers.


JSpell SDK 2004 Spell Checker for the Java (tm) Platform
Copyright © 1996-2005 The Solution Cafe Inc, All Rights Reserved - http://www.thesolutioncafe.com