Next: Feature Matching
Up: The definition of a
Previous: Structural Matching
Output Generation
Although nothing has yet been said about the feature
equations, which is the subject of the next subsection, we assume that only
matches that meet the additional constraints imposed by feature equations
are considered for output. If no structural match survives feature equations
checking, that matching has failed.
If the process of matching lhs to inp fails, there are two
alternative behaviors according to the value of a parameter25.8.
If the parameter is set to false, which is the default value,
no output is generated.
On the other hand, if
it is set to true, then the own inp tree is copied to the output.
If the process of matching succeeds, as many trees will be generated in the
output as the number of possible matches obtained in the process. For a
given match, the output tree is generated by substituting in the rhs tree
of the metarule the occurrences of variables by the material to which they have
been instantiated in the match. The case of the typed-variable is simple.
The name of the variable is just substituted by the name of the node to which
it has been instantiated from inp. A very important detail is that the
marker (foot, substitution, head, NA, or none) at the output tree node comes
from what is specified in the rhs node, which can be different of the
marker at the variable node in inp and of the associated node from
inp.
The case of the non-typed variable, not surpringly, is not so simple.
In the output tree, this node
will be substituted by the subtree list that was associated to this node,
in the same other, attaching to the parent of this non-typed variable node.
But remember, that some subtrees may have been removed from some of the trees
in this list, maybe entire elements of this list, due to the effect of the
children of the metavariable in lhs.
It is a
requirement that any occurence of a non-typed variable node at the rhs
tree has exactly the same number of children than the unique occurence of
this non-typed variable node in lhs. Hence, when generating the output
tree, the subtrees at rhs
will be inserted exactly at the points where subtrees were removed during
matching, in a positional, one to one correspondance.
For feature equations in the output trees see the
next subsection. The comments at the output are the comments at the lhs
tree of the metarule followed by the coments at inp, both parts
introduced by appropriate headers, allowing the user to have a complete
history of each tree.
Next: Feature Matching
Up: The definition of a
Previous: Structural Matching
XTAG Project
1998-09-14