11.16.16 Specification rules for a dictionary creation file
This subsection describes the specification rules for a dictionary creation file.
- Organization of this subsection
(1) Specification example of a dictionary creation file
The following describes a specification example of a dictionary creation file used when registering synonym dictionary Dictionary2.
<Specification example of a dictionary creation file>
Dictionary2,/home/adbmanager/dictionary2_synonym.txt,CORRECTIONRULE,general term↓
Legend: ↓: Line feed
- Explanation:
-
The following four items are specified in the dictionary creation file. Specify individual items by delimiting with a comma (,).
-
synonym-dictionary-name (Specify this on the first line.)
-
synonym-list-definition-file-name (Specify this on the second line.)
-
notation-correction-option (Specify this on the third line.)
-
comment (Specify this on the fourth line.)
-
(2) Contents specified for individual items in a dictionary creation file
- ▪ First line
-
synonym-dictionary-name: ~<character string> ((1 to 120 bytes))
Specify the synonym dictionary name. We recommend that you specify a simple name for a synonym dictionary name because it is specified in an SQL statement.
You can specify a character string for a synonym dictionary name by using half-width alphabetic characters (A to Z, and a to z), half-width numeral characters (0 to 9), and underscores (_).
- Important
-
If you specify an already registered synonym directory name, that synonym dictionary is reregistered. Therefore, when you register a new synonym dictionary, be careful not to specify a dictionary name that has already been registered. You can check whether there are already registered synonym dictionaries by retrieving the system table. For details about how to retrieve data from the system table, see (2) Checking the information about all synonym dictionaries in 11.16.4 Checking the information about synonym dictionaries.
- ▪ Second line
-
synonym-list-definition-file-name: ~<OS path name> ((2 to 510 bytes))
Specify the synonym list definition file name by using the absolute path name.
The following shows the specification rule for a synonym list definition file name:
-
Control characters (0x00 to 0x1f, and 0x7f) cannot be specified.
-
- ▪ Third line
-
notation-correction-option:
Specify whether to create a synonym dictionary that supports correction search. Specify either of the following:
-
CORRECTIONRULE or CR
Specify this when you create a synonym dictionary that supports correction search.
-
CASESENSITIVE or CS
Specify this when you create a synonym dictionary that does not support correction search.
You can use a synonym dictionary created by specifying CORRECTIONRULE even when correction search is not performed. Therefore, we recommend that you specify CORRECTIONRULE if you are uncertain whether to perform correction search when creating a synonym dictionary.
- Note
-
-
You can select whether to perform correction search in the specification of the scalar function CONTAINS when you perform a synonym search operation.
-
If you change a synonym dictionary that does not support correction search to a synonym dictionary that supports correction search, you need to reregister that synonym dictionary.
-
- Important
-
If the character encoding used on the HADB server is Shift-JIS (if the value specified for the environment variable ADBLANG is SJIS), correction search operations cannot be performed. Therefore, you cannot specify CORRECTIONRULE for the correction search option.
If you omit specifying the correction search option, CASESENSITIVE is assumed.
Example: when specification of the correction search option is omitted:
Dictionary3,/home/adbmanager/dictionary3_synonym.txt,,detailed term
-
- ▪ Fourth line
-
comment: ~<character string> ((0 to 1,024 bytes))
Specify a comment for the synonym dictionary.
If you are uncertain which synonym dictionary should be used for synonym search, display the list of synonym dictionaries to identify the synonym dictionary to be used. When you do so, you can identify the synonym dictionary by checking the comment specified here. Therefore, specify a comment that is relevant to the contents of the synonym dictionary.
- Note
-
-
To display the list of synonym dictionaries, retrieve the system table. For details, see (2) Checking the information about all synonym dictionaries in 11.16.4 Checking the information about synonym dictionaries.
-
In the list of synonym dictionaries, sets of the synonym dictionary name and the comment specified here are displayed.
-
The following shows the specification rules for a comment:
-
Control characters (0x00 to 0x1f, and 0x7f) cannot be specified.
-
You can omit specifying a comment.
Example: when specification of a comment is omitted:
Dictionary2,/home/adbmanager/dictionary2_synonym.txt,CORRECTIONRULE,
(3) Specification rules for a dictionary creation file
-
In a dictionary creation file, you can specify information about multiple synonym dictionaries. For details, see (4) Notes.
-
The maximum number of synonym dictionaries that can be registered is 50.
-
Information about one synonym dictionary is written on one line.
-
Input a line break at the end of each line. Also, input a line break at the last line of the dictionary creation file. Use as the line break code one from X'0A' (LF), X'0D0A' (CRLF), or X'00'.
-
If there is a line that has only a line break, that line is skipped when processing is executed.
-
Create a dictionary creation file by using the character encoding specified for environment variable ADBLANG.
-
You can specify double quotation marks (") as enclosing characters. If a character string (for example, a character string for a comment) to be specified contains ,, enclose the character string by the enclosing characters.
Example:
Dictionary3,/home/adbmanager/dictionary2_synonym.txt,CORRECTIONRULE,"general term,related to law"
(4) Notes
In a dictionary creation file, you can specify dictionary information about multiple synonym dictionaries as follows. In this case, you can register multiple synonym dictionaries by one execution of the adbsyndict command.
Example:
Dictionary1,/home/adbmanager/dictionary2_synonym.txt,CORRECTIONRULE,general term↓ Dictionary2,/home/adbmanager/dictionary3_synonym.txt,CASESENSITIVE,detailed term↓
Legend: ↓: Line feed
For example, if you perform the following operations, specify multiple synonym dictionaries as is done in the preceding example:
-
When adding, modifying, or deleting synonyms in Dictionary1, the synonyms in Dictionary2 also need to be added, modified, or deleted.
If you do not perform such operations, we recommend that you specify the dictionary information about only one synonym dictionary for one dictionary creation file.