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 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.