In order to find arguments connected by specific dependencies in a dependency graph use the function dnode()

dnode([label], term1, …​)

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

pdl dnode 1

"An important rich customer was very angry."

pdl dnode 2

"Although the issue wasn’t very important, the customers continued to complain."

dnode(sbj, customer) returns both "An important rich customer was very angry" and "…​while customers continue to complain" as they are both linked with subject dependency.

dnode(sbj, phrase(2, important, customer)) returns only "An important rich customer was very angry", because "important rich customer" is a valid tree fragment, while "important, the customers" is not.

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

pdl dnode 3

"A rich customer bought an expensive car."

dnode(buy, dnode(sbj, customer), dnode(obj, car, dnode(nmod, expensive))) returns "A rich customer bought an expensive car".

The query dnode() is useful for extracting “sparse” patterns, i.e. when target words may be separated by many other words.

dnode(will, dnode(vc, increase), dnode(sbj, sales)) allows to extract pattern sales will increase even if arguments are separated by many other words.

pdl dnode 6