In corpora containing hierarchical structures, annotations such as syntax trees can be searched for by defining terminal or none-terminal node annotations and their values. A simple search for prepostional phrases in the small PCC2 demo corpus looks like this:
tiger:cat="PP"If the corpus contains no more than one annotation called cat, the optional namespace, in this case tiger:, may be dropped. This finds all PP nodes in the corpus. To find all PP nodes directly dominating a proper name, a second element can be specified with the appropriate part-of-speech (pos) value:
cat="PP" & pos="NE" & #1 > #2The operator > signifies direct dominance, which must hold between the first and the second element. Once the Result Window is shown you may open the "tiger" annotation level to see the corresponding tree.
Note that since the context is set to a number of tokens left and right of the search term, the tree for the whole sentence may not be retrieved. To do this, you may want to specifically search for the sentence dominating the PP. To do so, specify the sentence in another element and use the indirect dominance ( >* ) operator:
cat="S" & cat="PP" & pos="NE" & #1 >* #2 & #2 > #3If the annotations in the corpus support it, you may also look for edge labels. Using the following query will find all adjunct modifiers of a VP, dominated by the VP node through an edge labeled MO. Since we do not know anything about the modifying node, whether it is a non-terminal node or a token, we simply use the node element as a place holder. This element can match any node or annotation in the graph:
cat="VP" & node & #1 >[tiger:func="MO"] #2It is also possible to negate the label of the dominance edge as in the following query:
cat="VP" & node & #1 >[tiger:func!="MO"] #2which finds all VPs dominating a node with a label other than MO.