Dictionary Attributes
Attributes are additional information about an entry. Each attribute type has its own a sub types, and optionally takes a name.
There are three types of attributes each serves different function:
feature: // to add an output feature to the entry.
cond: // to require an extra condition to be met for that entry.
generalise: // to enable matching of a variety of text snippets based on generalised forms (for example, pluralization).
All text snippets marked up by the generalised entry inherit the same set of attributes.
Attributes are written in this syntax:
attribute-type:attribute-name
Attributes can be used within columns or directly as a command.
Setting attributes by command
To use an attribute as a command, add a # symbol in front and put it at the beginning of a line in the Dictionary. Subsequent entries in the Dictionary will have that attribute.
For example:
#feature:gender male
#cond:context -corporate
This allows you to add the attribute globally to all entries forward until the end of the Dictionary.
Clearing attributes set by command
To clear a command attribute, use
#clear attribute
For example:
#clear cond:context
An an extended example (distributed with Sintelix as a demonstration Dictionary):
#wordlist Demo7-Clear
// setup attributes and columns to be cleared later
#feature:f1 "value1"
#feature:f2 "value2"
has-features-f1-f2
#cond:context word
#generalise:plural true
this is an example phrase
#cols text, feature:a
two, columns
// clear a single global feature
#clear feature:f1
// reset the columns to entry "text" only
#clear cols
back to one column // feature "f2" remains
// clear context condition
#clear cond:context
has-feature-f2
// clear plural form generation
#clear generalise:plural
// clear everything, except refname
#clear all
#feature:a A
#cols text, feature:b
two, columns
// when #wordlist is used, everything is cleared
#wordlist Demo7-Clear-implicit
no-features
back to one column // text column only, features "a" and "b" are gone
Conditional entries
Dictionaries allow two forms of conditional matching of word list entries:
- Typography (case)
- Context
Use the command:
#cond:case case_requirement
#cond:context context_requirement