Creating A Simple Dictionary With Definitions The KAS Knowledge Acquisition System allows you to create new dictionaries with definitions from scratch or append information to existing dictionaries. The dictionaries can be created from Unicode text files. Unicode was selected because all major microcomputers and operating systems support it, and it provides a much wider selection of characters than ASCII, including support for all the major foreign language characters as well. The basic format of the information for the dictionaries is as follows: FILENAME > @Level 0 0. word1 > definition1. word2 > definition2. word3 > definition. Note that the first word in the file must correspond to the name of the file minus the extension. Note that each word is separated from its definition by the character string > space right arrow space. Note that each word > definition pair is separated by the character string. space period space. Note also that the final definition in the set is followed by the character string. space period space. When you format your dictionary don t forget the. space period space after the final definition. Note that the number of definitions is only limited by the maximum file size allowed in the operating system and the size of any given definition can be as large as 500,000 Unicode characters. The file ANIMALS.TXT which is located in the SAMPLES folder on the distribution CD-ROM shows a simple example that we will use in this exercise. The contents of the file ANIMALS.TXT is as follows: ANIMALS > @Level 0 0. bird > flying animal with wings and feathers. dog > four footed animal that barks. cat > animal with four feet, fur, and whiskers. In this example, we have created the file using the Microsoft Word 2000 program. In reality, any word processor that supports Encoded Text Unicode (Big Endian) maybe used. Note that in the above file, spaces have been made visible as dots. file:///program Files/createdic/welcome.htm (1 of 8) [1/15/2001 3:50:17 PM]
Once your dictionary file has been created it is important to save it as Encoded Text. In Word 2000, this is one of the options that can be selected when performing the SAVE AS function. Note that once the SAVE AS function is performed, the program will ask you what type of Encode Text that you want. Be sure to select Unicode (Big-Endian). Since the program is written entirely in JAVA, the Unicode characters are expected to be in MSB, LSB order. file:///program Files/createdic/welcome.htm (2 of 8) [1/15/2001 3:50:17 PM]
The file that you have created may be stored in any location on your hard disk. Make sure that you remember where so that it can be used later. Converting Your Dictionary Once your dictionary text file has been created, you need to convert it to a file that can be quickly accessed by the KAS Knowledge Acquisition System. To do this, you need to go into the KAS program, select commands, and then select Import Unicode File. file:///program Files/createdic/welcome.htm (3 of 8) [1/15/2001 3:50:17 PM]
The program will then ask you to select a series of options. file:///program Files/createdic/welcome.htm (4 of 8) [1/15/2001 3:50:17 PM]
First select the source.txt file that contains the dictionary that you previously created with a word processor. Highlight the file that you would like to use. Next you need to determine if you would like to create a new dictionary, or to append to an existing one. In this example we have chosen to create a new dictionary. Note that if you already have a dictionary with the same name, this operation will copy over and destroy the previous dictionary. That is why the file name must correspond to the first word in the contents of the file so that the conversion will not occur if a dictionary is incorrectly selected. Next select the number of levels that you would like this dictionary to have. In this simple example, we choose only one level. Note that the number of levels corresponds to the number of nested subsections that the dictionary contains. Next you need to determine if wild cards are to be used. This is a very useful feature that allows you to find words in the dictionary even if you are not sure how to spell it, or look up a list of words by using an asterisk, just as you would when looking up file names on your hard disk. In this example, we chose to use wild cards so we click on the Yes button. file:///program Files/createdic/welcome.htm (5 of 8) [1/15/2001 3:50:17 PM]
Once you have enabled wild cards you will select either one wild card or two wild cards. In general, you will choose one wild card for small dictionaries and two wild cards for large dictionaries. In this case we have a small dictionary so we choose one wild card. Once this has been selected, the conversion process should start automatically. Once it is complete, the program should automatically select this dictionary, put it at the front of the list, and make it active. Note that the program will automatically create FILENAME.CNV and FILENAME.ALT files that will be stored in the KAS subdirectory under the location where the KAS program is store. If you use the standard defaults when installing the dictionary, this will be at C:/PROGRAM FILES/KAS/KAS. The first screen that you see should look somewhat like this: file:///program Files/createdic/welcome.htm (6 of 8) [1/15/2001 3:50:17 PM]
In this example, note that there is a b* c* and d* displayed on the screen. That is because the words that we added with definitions are bird, cat, and dog which start with b, c, and d respectively. Your screen may look somewhat different depending on what words are in your dictionary. file:///program Files/createdic/welcome.htm (7 of 8) [1/15/2001 3:50:17 PM]
At this point you may want to look up a word. To do that, double click on one of the wild cards, or key in one of the words directly. In the above example, we have looked up the word bird. Note that the KAS system gives priority to the current dictionary selected. It will only search the other dictionaries for the word if the Search Dictionaries on Word Not Found option is checked and the word is not found in the currently selected dictionary file:///program Files/createdic/welcome.htm (8 of 8) [1/15/2001 3:50:17 PM]