Using the mksyd Command-line Tool
You can use the mksyd command-line tool to build a compiled thesaurus (a file with the .syd
extension) that the application uses to find synonyms.
The easiest way to create a new English language thesaurus is to dump the existing English language thesaurus to an ASCII file, modify it, and recompile the .syd file. Use mksyd to export the .ctl control file from an existing .syd thesaurus file.
Creating a Control File from an Existing Thesaurus
To use the mksyd command-line tool to create a control file from the existing Verity English thesaurus, enter the following command:
- mksyd -dump -syd <vdknn.syd> -f <xxxxxx.ctl>
where vdknn is the version of the thesaurus file that you want to use, and xxxxxx is the name of the control file (with the extension .ctl
). Existing English .syd files are contained in /
verity/prdname/k2/common/english
directory (where /verity/prdname is the user-definable portion of the Verity K2 installation directory).
The resulting file is in the format:
- $control: 1
- synonyms:
- {
- list: "word1, synonym1-1, synonym1-2, synonym1-3"
- list: "word2, synonym2-1, synonym2-2, synonym2-3"
- list: "word3, synonym3-1, synonym3-2, synonym3-3"
- }
- $
You can create the control file from any specified thesaurus, as long as it is properly formatted.
Modifying a Control File for a Language Other than English
You can modify a control file for a language other than English by using a locale and character set specification. This description assumes that you have an existing thesaurus file with an .syd file extension.
Use the following steps to create the control file:
- 1. You must already have a thesaurus word list in an .syd file.
- 2. Type the following command on a single line (no carriage return):
- mksyd -locale locale_name -charmap charset -dump -syd fn.syd -f xxxx.ctl
The value for fn must be a .syd file. The value for locale_name must be the name of the locale being used (the English locale is named "english"). The value for charset must be a character set appropriate to the locale being used. For more information, see Appendix D, "Supported Languages."
Building a Custom English Thesaurus
To use the mksyd command-line tool to create a custom thesaurus, you must have already created a control file with the file extension .ctl
. In the same directory where that file resides, type the following command:
- mksyd -f control_file.ctl -syd fn.syd
where control_file is the name of an existing, properly-formatted control file and fn is the name of the thesaurus file that you want to create.
This command creates the specified custom thesaurus from the specified control file.
Building a Custom Non-English Thesaurus
To use the mksyd command-line tool to create a custom thesaurus in a language other than English, you must have already created a properly-formatted control file containing the thesaurus terms. That file must use the file extension .ctl. In the same directory where that file resides, type the following command on a single line (no carriage return):
- mksyd -locale locale_name -charmap charset -f control_file.ctl
-syd fn.syd
where locale_name is the locale being used. The value for charset must be a character set appropriate to the locale being used. For more information, see Appendix D, "Supported Languages." The control_file is the name of an existing, properly-formatted control file and fn is the name of the thesaurus file that you want to create.
The mksyd command-line tool requires the explicit entry of the locale name; a default locale is not used.
Copyright © 2002, Verity, Inc. All rights
reserved.