Table of Contents

Support - Customer Dictionary Installation Instructions

  1. Dictionary basic information
  2. Types of dictionaries used in SpellChecker
  3. Format of dictionaries
  4. Creating customer dictionary
  5. Configuring Application Server for using customer dictionary
    1. Location of customer dictionaries
    2. Customer dictionary settings file structure
    3. Managing customer dictionaries
  6. Adding customer dictionary to your Web application
  7. Appendix I. “Simple Steps to embed a custom dictionary”
  8. Appendix II. “How to add Additional Dictionary to SpellChecker.net application”

1. Dictionary basic information

SpellChecker's web interface consists of two parts: the user interface displayed in your Web browser and the server part, which produces the output for browser. When a spell checking request arrives, the server part contacts Application Server. Application Server breaks all the received text into individual words and checks each word separately using available dictionaries.

2. Types of dictionaries used in SpellChecker

There are three types of dictionaries used in SpellChecker:

The main dictionary is a standard dictionary shipped with the engine. It contains a general vocabulary of supported languages.

Customer dictionaries are company-wide dictionaries intended to extend the vocabulary of the standard dictionary, and can be customized for particular user groups. For example, if you want to add Legal or Medical (available on www.spellchecker.net), or your own dictionary to your Web application, you need to attach a corresponding customer dictionary.

3. Format of dictionaries

Application Server accepts dictionaries of two formats: textual and native.

A textual dictionary is stored in a text lexicon files (.tlx) and has a very simple structure: each line contains only one word (i.e. each word is followed by the carriage return character).

Note that the last line in the file must be empty, otherwise the last word won't be recognized by the dictionary.

A native dictionary is a compiled version of a textual dictionary (.clx). You can download the compiler here.

Compiling a dictionary into the native format will significantly improve the performance of Application Server when the number of words reaches several hundreds.

4. Creating a customer dictionary

To create a textual dictionary open a text editor and create your word list. The content of the word list should be sorted in alphabetical order. If you already have one, then you just need to convert it into the format specified above.

If the number of words in the dictionary amounts to several hundreds or more, we recommend that you compile it. Please note that if you prepare a custom word list which contains Unicode Symbols (this may happens when you prepare a non-English dictionary), you might encounter a problem during the compilation of wordlist. To avoid the problem, you can download the Perl script here which may convert your dictionary from Unicode charset to ANSI.

5. Configuring Application Server for using customer dictionary

Location of customer dictionaries

The main SpellChecker settings are maintained in an XML file, called “AppServerX.xml”. Other settings are stored in other various files, which are referred to from the corresponding sections. This file can be found at <SpellCheckerProgramFolder>\AppServer\AppServerX.xml. The content of the file is quite complicated; however, it is well structured.

<AppServerIni>
     …
         <DSN>CustomerDb.xml</DSN>
         <CustDictSubdir>CustDict</CustDictSubdir>
     …
 </AppServerIni>

In our case we only need two settings: AppServerIni\DSN and AppServerIni\CustDictSubdir.

The “DSN” setting keeps the name of the XML file with the list of customer dictionaries, its default value equal to CustomerDb.xml. You may prepare several XML files and use them as needed by changing this value. Note that this field must never be empty.

You can choose to store your dictionary files into a separate folder. To specify the folder where you want to store your customer dictionaries, you should change the “CustDictSubdir” setting. The default value is “CustDict”.

Customer dictionary settings file structure

Create CustomerDb.xml file in the “AppServer” folder. The Customer dictionary settings file is also a valid XML file with the following structure:

<CustomerDb>
     <Dictionary DicId="1">
         <FileName>PetsForm.clx</FileName>
         <Description>English dictionary for Pets Forum</Description>
         <LangShortName>am</LangShortName>
     </Dictionary>
     …
 </CustomerDb>

You can have as many dictionaries in your system as you want; however, each dictionary should have an identifier. Therefore, be careful to assign a unique identifier to each dictionary on your site.

Managing customer dictionaries

Now that your dictionary settings file and corresponding dictionary files are ready, you can attach and detach them in your system by modifying the AppServerIni\DSN attribute in the main settings file.

For Application Server versions 1.2.2.0 and earlier, you will need to restart your application server. On startup, AppServer will re-load an updated list of customer dictionaries. You don't need to restart the application server for Application Server version 1.2.2.1 and later, since it provides a “Reload on the fly” feature.

You can find your current AppServer version in the “File Version” field in properties of the executable. In Windows explorer, navigate to the AppServerX.exe executable, go to its properties (right-click on the file, choose “Properties”) and switch to “Version” tab.

6. Adding a customer dictionary to your Web application

The HTML page that invokes SpellChecker will include the engine just like it does with a usual external script. Since you need to pass additional parameters to the engine, you will need to assign an array of custom dictionary names to the “customDictionaryName” property.

This is how it must look on your page for a WSC solution:

<script type="text/javascript">
     //<!--
         …
         doSpell({
             ctrl:"myEditor",
             lang:"en",
             customDictionaryName:["1","3001"]
         });
         …
     <//-->
 </script>

In the example above, we have attached custom dictionaries 1 and 3001.

7. Appendix I. "Simple Steps to embed a custom dictionary"

Check whether AppServerX.xml contains the Customer Dictionary-related elements

 <DSN>CustomerDb.xml</DSN>
 <CustDictSubdir>CustDict</CustDictSubdir>

Create a directory for your Customer dictionary. On Windows Platform, it is <SpellCheckerProgramFolder>\AppServer\CustDict\

Put your dictionary file(s) into the Customer Dictionary directory. On Windows Platform, <SpellCheckerProgramFolder>\AppServer\CustDict\

Create a CustomerDB.xml file in the root directory of Application Server. On Windows Platform, it is <SpellCheckerProgramFolder>\AppServer\. Put the following content into this file:

<CustomerDb>
	 <Dictionary DicId="1">
	 	<LangShortName>am</LangShortName>
		<FileName>dict_file.tlx</FileName>
		<FileName>dict_file.clx</FileName>
		<Description>My Custom Dictionary</Description>
	 </Dictionary>
 </CustomerDb>

Add a “customDictionaryName” property for the SpellChecker initialization object.

For a WSC solution:

 doSpell({
     ctrl:"myEditor",
     lang:"en_US",
     customDictionaryName:["1","3001"]
 });

Reload the page and test whether the words from your dictionary are not marked as errant.

7. Appendix II. "How to add Additional Dictionary to SpellChecker.net application"

Please review the instruction.

Contact Support Team

Leave a message for Spellchecker Technical Support