Dict Files
RapidSpell supports 2 types of dictionary, JAR (default) and .dict file. JAR based dictionaries are compressed, static and easier to deploy, whereas the .dict file format is faster and can be customized, however its path must be specified in code:
Using a JAR dictionary
This should be automatic, all that is required is that the RapidSpellMDict.jar is in the same folder as RapidSpellWeb.jar.
Customizing and using a .dict dictionary
- Find the ".dict" file version of the English dictionary you want to use (US) in the Dictionaries folder (inside the ZIP).
- Edit that .dict file using the DictManager tool (it's a GUI tool under the DictManager folder (inside the ZIP). You can add ones one at a time or from a text file.
- Use the .dict file by either calling
- (For JS based usage)
rapidSpell.setParameterValue('default', 'DictFile', '~/somedir/filename.dict');
(where ~/ will be interpreted as the web application root)
- (For Tag based usage, set in the RapidSpellWInline or RapidSpellWebLauncher tags)
dictFile="~/somedir/filename.dict"
(where ~/ will be interpreted as the web application root)
Programmatic use of Dict Manager
To use Dict Manager programmatically:
-
Add DictManager.jar to your classpath, or lib.
-
Create an instance: model = new com.keyoti.rapidSpell.DictManagerModel();
-
Use any of the API calls:
- createDict
- loadDict
- addWord
- mergeDictFile
- mergeTextFile
- removeWord
- lookUp
- saveDict
- Creates a new dict file
- Loads an existing dict file
- Adds a word to current open dict file
- Merges an existing dict file with the open dict file
- Merges an existing text file with the open dict file
- Removes a word from the dict file
- Checks if a word is in the dict file
- Saves the currently open dict file
- Typical usages should be in the following order;
- create or load
- modifying operations
- save.