next up previous contents
Next: Lexical Organization Up: Metarules Previous: Examples

   
The Access to the Metarules through the XTAG Interface

We first describe the access to the metarules subsystem using buffers with single metarule applications. Then we proceed by describing the application of multiple metarules in what we call the parallel, sequential, and cumulative modes to input tree files. We have defined a metarule conceptually as an ordered pair of trees. In the implementation of the metarule subsystem it works the same: a metarule is a buffer with two trees. The name of the metarule is the name of the buffer. The first tree that appears in the main window under the metarule buffer is the left hand side, the next appearing below is the right hand side27.10. The positional approach allows us to have naming freedom: the tree names are irrelevant27.11. Since we can save buffers into text files, we can also talk about metarule files.
The available options for applying a metarule which is in a buffer are: The other options concern application to files (instead of buffers). We will first define the concepts of parallel, sequential and cumulative application of metarules. One metarule file can contain more than one metarule. The first two trees, i.e., the first tree pair, form one metarule - call it mr0. Subsequent pairs in the sequence of trees define additional metarules -- mr1, mr2, ..., mrn. Remember that in case of matching failure the output result is decided (as explained in subsection C.2.3) either to be empty or to be the input tree. The reflex here of having the parameter set for copying the input is that for the parallel application the output will have as many copies of the input as matching failures. For the sequential case the decision is applied at each level, and setting the parameter for copying, in a certain sense, guarantees that subsequent metarule applications will not break. Due to its nature, and unlike the two other modes, the cumulative application is not affected by this parameter. The options for application of metarules to files are available by clicking on the menu item Tools and then choosing the appropriate function from the following: The Tools menu also has entries to change the parameters of execution of metarules. We saw earlier in this section how to set the parameter that controls the name of the tree. Another parameter, explained in Subsection C.2.3, is the one that controls the output result on matching failure. We can change it in the menu by selecting either copy input on mr matching failure or no output on mr matching failure. Recall that this parameter does not affect the cumulative mode. The third parameter controls comments generation. By choosing append metarule comments at the Tools menu, the subsequent metarule applications will produce output trees whose comments are the comments at the lhs tree of the metarule followed by the comments at inp. Both parts are introduced by appropriate headers, allowing the user to have a complete history of each tree. Choosing do not append metarule comments makes the comments at the output trees be exactly the same at the input tree. The third option, clear comments on metarule application, causes the comment field to be left empty at the ouput trees. The default values for the tree parameters when XTAG is started are set: to generate the output trees with the same name as the input; not to copy the input tree in case of matching failure; and to add the metarule comments to the output tree.
next up previous contents
Next: Lexical Organization Up: Metarules Previous: Examples
XTAG Project
http://www.cis.upenn.edu/~xtag