Assignment 9: Flag diacritics in Esperanto
Flag diacritics are special kind of epsilon symbols. An arc labelled
with a flag diacritic is traversed without consuming any input but
the traversal can be made only if the action associated with the
flag succeeds.
The general form of flag diacritics is
- @ACTION.ATTRIBUTE.VALUE@
or
- @ACTION.ATTRIBUTE@
where ACTION is one of the following symbols
- U
- Unify ATTRIBUTE with VALUE. This action
fails if the attribute already has an incompatible value. If the
attribute has not been set to any value, unification succeeds.
Successful unification sets the attribute to the given value.
- R
- Require ATTRIBUTE to have VALUE. This
action succeeds just in case the attribute has already been set to
the given value. If the attribute has not been set to any value or
if it has an incompatible value, the require action fails.
- R
- Require ATTRIBUTE. This action fails if
the attribute does not have a value. It succeeds if the attribute
has a specific value, regardless of what the value is.
- D
- Disallow ATTRIBUTE having VALUE. This
action fails if the attribute has the given value. If the attribute
has not been set to any value or if it has an incompatible value,
the disallow action succeeds.
- D
- Disallow ATTRIBUTE. This action fails if
the attribute has a value, regardless of what that value is. It
succeeds if the attribute is undefined.
- P
- Set ATTRIBUTE to VALUE. This "positive set" action always succeeds.
- N
- Set ATTRIBUTE to the complement of VALUE.
This "negative set" action always succeeds. If an attribute is set to a
complement of a given value, it is compatible with all the other values
of the same attribute.
- C
- Clear ATTRIBUTE. This action always succeeds. It
restores the attribute to the initial state that is compatible with
any value.
The attribute and value names can be chosed freely. For example, you
might see flag diacritics such as @U.Harmony.Back@,
@N.Vowel.a@, @P.OK.NO@. There is no limit on the
number of attributes or the number of values per attribute.
Functions such as apply up and apply down in
xfst enforce flag constraints without showing the flag symbols
when the parameter obey-flags is set to ON (default).
If obey-flags is set to OFF, flag constraints are
not enforced and the flag symbols are shown in the output although
they are still treated as epsilons on the input.
Setting an attribute to a given value along a path has an effect on
how that path can be continued. It has no effect outside of that
context, for example, on other paths branching off from the same
state.
The Task
Starting with your solution to Assignment 6 (Esperanto nouns and
adjectives), add some flag diacritics to express the constraint
%+MF => _ ~$[%+Fem] %+Pl
That is, if a noun starts with ge prefix, then it must include
the plural j and cannot contain the feminine in
suffix. Compile your esperanto lexicon with lexc and write
the result to a file with the save-source command.
Try using the apply commands in xfst on your lexicon
with the obey-flags parameter set to OFF as well as
ON (default). Eliminate the flags with the eliminate
flag command and verify that you get the expected result. With
obey-flags set to ON, you should see the following
behavior:
apply up> hundo
hund+Noun+NSuff+Sg
apply up> hundoj
hund+Noun+NSuff+Pl
apply up> gehundoj
MF+hund+Noun+NSuff+Pl
apply up> gehundo <-- Fails because of lack of j.
apply up> hundinoj
hund+Noun+Fem+NSuff+Pl
apply up> gehundinoj <-- Fails because of presence of in.
After eliminating the flags, you should get this behavior regardless
of the setting of the obey-flags parameter.
Here is my own solution to this assignment.
Copyright © 1998 Xerox Corporation.