JSpell Console

From JSpell
Jump to: navigation, search

JSpell Console is a Java Swing based application used to create JSpell JDX format dictionary files. The JDX format is the dictionary file format used by: JSpell HTML, JSpell Evolution, JSpell IFrame and JSpell SDK. The JDX file format created by this tool is NOT compatible with JSpell Toolbar which relies on an earlier version of the JSpell Spell Checker API.

Contents

Getting Started

Installation

Place your source word lists and the jspellconsole.jar file into the same directory on your system. A typical directory listing showing a source word list and the JSpell Console .jar application appears as follows:

enUS.txt		English language source word list
jspellconsole.jar	JSpell Console

Starting

To start JSpell Console simply double-click on the application icon or launch it from the command line:

java -jar jspellconsole.jar

Commands are entered at the very bottom of the console window and the primary commands you will use are: BUILD, to create a JDX file; OPEN, to take action on an existing JDX file; and SEARCH, to test the JDX file. Of course you will also use QUIT to terminate the application.

Source Word List

The first step to creating a JDX file is creating or obtaining a source word list in the proper format. If you're a currently licensed customer of JSpell then the official word lists are available to you at no cost. You can also use open source word lists provided they are in the correct format.

File format

The source word list should follow these conventions:

  • one word per line
  • each line terminated with a CR/LF
  • all accent characters are included as-is
  • all word variations must be included, e.g. walk, walks, walking, walked, etc.
  • no punctuation, except for embedded apostrophes
  • words may contain a number but must not begin with a number, e.g. H2O
  • source word list should be sorted and unique
  • source word list must be saved in Unicode format. Windows Notepad.exe can save a file in this format using File/Save As.
  • the source word list file name should have the ISO language code in lowercase, followed by the ISO country code in uppercase with a .txt extension, e.g. enUS.txt. This is not mandatory but recommended.

Capitalization

  • most words should be lowercase
  • proper nouns should be appropriately capitalized, e.g. Houston
  • acronyms should be included with proper capitalization, e.g. NASA
  • if a word is both a proper noun and a regular word then you should enter both forms of the word in the word list

Example

An example file could appear as follows:

apple
Apple
BMW
café
JSpell
Lisa
Lisa’s
zebra

Creating a JDX File

After you have constructed your word list and launched the console utility, you may create or "build" your JDX file. For example, if your source word list is named enUS.txt and you're building a US English dictionary, execute the following command in the console utility (in the command input area at the bottom of the window):

BUILD enUS.txt en US

The command part of the above line specifies which command to execute, in this case "BUILD". Note: commands and parameters are each separated by a single space character.

The first parameter, "enUS.txt", is the source word list file name (the console looks for the file in the same directory in which the console was started). Remember, the source word list MUST be in Unicode format.

The second parameter, "en", is the two-letter ISO language code.

And, the third parameter, "US", is the two-letter ISO country code.

Upon executing this command you should see the progress of the dictionary compilation showing every thousandth word in your source word list, for example:

C:\jspell
Detected Big Endian Unicode Format Input File
actress
agriculturalists
amiably

When the build process is complete you should see a summary of the number of words in the dictionary:

Read 113575 words

Testing Your JDX File

After successfully completing the above steps you will have a file in your working directory named lex_enUS.jdx. All JSpell JDX dictionary files have the same format, “lex_” followed by the ISO language code, the ISO country code and a .jdx extension.

To test the dictionary you need to first open it using the OPEN command in the console. To open the dictionary we just created enter the following command in the console:

OPEN en US

You should see a message similar to the following:

Opened: JSpellDictionaryLocal: ready? true en US

If you see:

Index is not ready, due to inability to open file

Then you’ve either not created the dictionary properly and should recheck your steps or you’ve mistyped the ISO language and country codes. Note: the console is case-sensitive.

After you’ve successfully opened the dictionary you may test it using the SEARCH command. The SEARCH command takes one parameter, a word to search for. If you type a correctly spelled word, for example:

SEARCH zebra

Then you won’t really see anything! But, if you type an incorrectly spelled word, for example:

SEARCH zebbra

Then you should see something similar to the following:

Misspelled Word: zebbra
    At Position: 0
    Suggestions: zebra

Feel free to try other words to confirm that your dictionary is working properly.

Installing Your JDX File

After you’ve successfully created a JDX file you can use it within your JSpell compatible applications by copying the file to the appropriate location for your JSpell product. For example, if you are using JSpell HTML with Windows IIS then this would typically be the following directory: C:\Program Files\JSpell Spell Checker\lexicons.

Important: you must stop the JSpell service, copy your dictionary to the right location and then restart the JSpell server for the new dictionary to be recognized. Also, if you have multiple dictionaries in your system make sure to either delete (in which case all dictionaries are used) or update the file lexicons.lst which is a list of all the dictionaries to make available to your users.

Command Reference

In most cases you will not need any console commands other than BUILD, OPEN, SEARCH and QUIT. However, we have provided a brief summary of each command in the console application for completeness of the documentation. Any text inside of brackets [] is a parameter for the command.

ADD [word]

Adds a words to an existing JDX index, use OPEN to open the index before using this command. We do not recommend using this command if at all possible as the source word list is not updated. However, if you do not have access to the source word list and want to quickly add a word to an existing JDX file then this is the command to use.

BUILD [source, ISO lang, ISO ctry, other]

This is adequately documented in the previous section however there is an additional parameter ‘other’ which can be anything you’d like in order to distinguish a dictionary on more than just language and country. For example, the JSpell US English Medical dictionary was created using the command: BUILD enUSMed.txt en US Medical You could use the ‘other’ parameter for department or division names, etc.

CD [path no trailing ‘\’ or ‘/’]

Changes the 'virtual' current working directory. Not recommended to use. For simplicity just keep all console related files in the same directory.

CLEAR

Clears the Output Window

DIR [directory]

List directory contents of virtual current working directory.

GUI

Creates an editable window to test the spell checker, closes previous one if it exists. Type in the GUI window and execute the command GUICHECK, see below.

GUICHECK

Tests the contents of the GUI window opened in the previous command.

HELP

Shows a brief help screen.

OPEN [ISO lang, ISO ctry, other]

Opens a dictionary for use with the ADD, GUICHEC, SEARCH and REMOVE commands. Accepts optional ‘other’ parameter for operation with ‘special’ dictionaries such as the US English Medical dictionary. The syntax to open the standard JSpell US English Medical dictionary is: OPEN en US Medical which would open the file lex_enUSMedical.jdx.

REMOVE [word]

Removes a word from an existing JDX index, use OPEN to open the index before using this command. We do not recommend using this command if at all possible as the source word list is not updated. However, if you do not have access to the source word list and want to quickly remove a word from an existing JDX file then this is the command to use.

SEARCH [word]

Searches for ‘word’ in the dictionary. If it is not found then suggestions are shown in the Command Output window.

QUIT

Exits the application

Personal tools