Here is the syntax of each definition group:
Syntax of a thesaurus definition >>-:WORDS--+---------------------------------+--\n--------------> +-:SYNONYM------------------------+ +-:RELATED--+------------------+--+ | '- ( --number-- ) -' | +-:BROADER--+------------------+--+ | '- ( --number-- ) -' | '-:NARROWER--+------------------+-' '- ( --number-- ) -' .----------------------------------------------------------------. V | >----+-member-term--+--------------------+--------------------+--\n-+->< | '- ( --strength-- ) -' | '-+-.SYNONYM_OF-----------------------+--associated-term-' '-.RELATED_TO--+------------------+-' '- ( --number-- ) -'
Note that \n is not part of the syntax, but represents the end of a line in the thesaurus definition file.
You can insert comment lines in a thesaurus definition file like this:
# my comment text
Relation names consist of a relation type and a number. If the number is omitted, zero is assumed, which is the system-provided relation name. :SYNONYM is always the system-provided relation name.
Relation names that begin with a colon, such as :SYNONYM, precede a list of words that are related to each other by the same relation. For example:
:WORDS :SYNONYM air steward cabin staff member flight attendant
This parameter can be useful if you do not want a thesaurus lookup to include words that have a weak relation to the looked up term. Strength is a numerical value from 1 to 100. The default value is 100.
Relation names that begin with a period, such as .SYNONYM_OF, define the relation between one word and another. For example:
:WORDS air steward .SYNONYM_OF cabin staff member .SYNONYM_OF flight attendant
The optional number identifies a user-defined relation. This must be a unique number from the whole thesaurus definition file (currently 1 to 128). For example: RELATED_TO(42).
If you want to use symbolic names for thesaurus relations in your application instead of the relation name and number, your application must handle the name-to-number mapping. For example, if you define the relation opposite_of as RELATED_TO(1), your application must map this name to the internal relation name RELATED_TO(1).
Here is an example of an associated term:
:WORDS:SYNONYM reject decline RELATED_TO(1) accept