next up previous contents
Next: Examples Up: The definition of a Previous: Output Generation

Feature Matching

In the previous subsections we have considered only the aspects of a metarule involving the structural part of the XTAG trees. In a feature based grammar such as XTAG, accounting for features is essential. A metarule must account for the proper change of feature equations27.8 from the input to the output tree. The aspects that have to be considered here are: Based on the combinations of these aspects the user may specify for a feature equation to be considered in the following ways: There are also some directives available to handle feature equations. For convenience and conformance with the pre-existing interface functions, these directives were defined to be included in the lhs tree as feature equations among the equations for requirement/copy defined above. The equations/directives will be interpreted and executed in the order they appear in the feature equations list definition of the lhs tree. The general format of a directive is:
Dname1 dummy1 name2
where ``D'' is a single character that specifies the directive, as listed below; name1 and name2 are parameters of the directive; and dummy1 (which may literally be the word ``dummy'') is required only to conform to the pre-existing format for feature equations in XTAG. There must be no blank space between the directive symbol and name1. The currently implemented directives are:
replace name1 with name2 in all equations from the input tree.
|:
exchange name1 and name2 in all equations from the input tree.
!:
remove all equations where name1 appears (here, name2 is also dummy).
Notice that the equations are executed in order. Hence, for instance, if there is a directive to remove equation E before an equation that requires E to be present for matching, matching will always fail. Similarly replacing and exchanging feature names will affect and be affected by the behavior of surrounding equations. In the rest of this subsection we define the role of the meta-variables in the feature equations. Importantly, we will overload the notation used up til now in this chapter and use the terms ``left'' and ``right hand side'' (lhs and rhs for short) to refer to the sides of a feature equation from a tree, and not only to the sides of the metarule. Non-typed variables don't play any role in the manipulation of feature equations by the metarules. Typed variables can be used in feature equations in both lhs and rhs side of the equation. They are intended to represent the nodes of the input tree with which the variables have been instantiated. For each resulting match from the structural matching process the following is done: Finally, a new kind of metavariable, which is not used at the nodes, can be introduced in the feature equations part. It has the same form of the non-typed variables, i.e., a question mark followed by a number, and is used in place of feature values and feature names. Hence, if the equation NPr.b:<?2> = ?3 appears in lhs, then all feature equations of inp that equate a certain bottom attribute(?2) of node NPr to a certain feature value (?3) (but not to a feature path) will not be copied to the output. Notice that before the first time the variables ?2 and ?3 match an equation from inp, they are free and can match any feature value/name. But after a match occurs, they become bound to the matched values, and henceforth they will only match these values.
next up previous contents
Next: Examples Up: The definition of a Previous: Output Generation
XTAG Project
http://www.cis.upenn.edu/~xtag