An affix is either a prefix or a suffix attached to root words to make other words. For example
supply -> supplied by dropping the "
y" and adding an "i
ed" (the suffix).
Here is an example of how to define one specific suffix (the past tense).
| D |
Y |
4 |
|
| D |
0 |
d |
e |
| D |
y |
ied |
[^aeiou]y |
| D |
0 |
ed |
[^ey] |
| D |
0 |
ed |
[aeiou]y |
So this information can be interpreted as follows:
The first line has
3 fields:
- D - is the name of the character which represents this suffix (affix key)
- Y - indicates it can be combined with prefixes (cross product)
- 4 - indicates that sequence of 4 affix entries are needed to properly store the affix information
The remaining lines describe the unique information for the 4 affix entries that make up this affix.
Look at the third line:
- D - is the name of the character which represents this affix (affix key)
- y - the string of chars to strip off before adding affix (a 0 here indicates the NULL string)
- ied - the string of affix characters to add (a 0 here indicates the NULL string)
- [^aeiou]y - the conditions which must be met before the affix can be applied (similar to regular expression)
Field
4 is interesting. Since this is a suffix, field
4 tells us that there are 2 conditions that must be met. The first condition is that the next to the last character in the word must
*NOT* be any of the following "
a", "
e", "
i", "
o" or "
u". The second condition is that the last character of the word must end in "
y".
Let's create one more suffix (the continuous tense).
| G |
Y |
2 |
|
| G |
e |
ing |
e |
| G |
0 |
ing |
[^e] |
Affix keyss can be specified in the word list (
[Words] section) by specifying them after the '
/' character:
word/affix keys
For example:
create/DG
will associate the '
D' and '
G' flags with the word '
create'.
Words '
created' and '
creating' are "
added" to dictionary with our rules!