Dependency Graph Search
In order to find arguments connected by specific dependencies in a dependency graph use the function dnode()
The first optional argument label refers to the specific dependency label. If it is not specified, the function matches any argument with any dependency label. It is possible to write more than one dependency labels, using the sign "|".
The current version of dependency parser supports approximately 30 dependency labels. These are some of the most common labels:
Label |
Meaning |
Example |
NMOD |
Nominal modifier |
economic news \(\text{news}\overset{nmod}{\rightarrow}\text{economic}\) |
OBJ |
Object |
Company increased sales. \(\text{[ROOT]}\overset{root}{\rightarrow}\text{was}\) |
SBJ |
Subject |
Sales have increased. \(\text{hope}\overset{tmp}{\rightarrow}\text{now}\) |
VC |
Verb chain |
Sales have increased. \(\begin{array}{rlc} \text{have} & \overset{vc}{\rightarrow} \text{increased} \\ \overset{sbj}{\downarrow} \\ \text{sales} \end{array}\) |
For all supported dependency labels users can consult Dependency Labels.
The function argument may be either a token or a phrase.
NOTE The argument should be part of a tree with one input arrow. In this case the function relates the link of the top given tree part to the other arguments of the function. If the argument of several tokens is not part of the tree, the function produces a null result.
Example
Nested functions may also be used. Nested dnode() functions allow to specify arguments that should depend on the current argument in the dependency graph. Using nested dnode() functions it is possible to match a complex pattern in a dependency graph.
You can also shorten the function, i.e. write dnode(A, B) instead of dnode(A, dnode(B)). Notice that you cannot specify a dependency label in this case.
Example
The query dnode() is useful for extracting “sparse” patterns, i.e. when target words may be separated by many other words.