Search by Constituents
In order to find a lexeme as a part of a syntactic constituent use the function constituent().
Syntax
The first optional parameter constituent_type allows to specify a constituent’s label and accepts one of the values from the constituency tree. Here are the most common labels.
constituent_type |
Description |
Example |
np |
Noun Phrase |
a senior lawyer the most often used accounts the Harvard Graduate School |
vp |
Verb Phrase |
contact your representative will participate via conference call |
adjp |
Adjective Phrase |
clinically significant most innovative and secure |
advp |
Adverb Phrase |
as easy as possible even more |
pp |
Prepositional Phrase |
for your help |
sbar |
Dependent Clause |
I’ll let you know [when we have some new information] |
s |
Clause |
I hope you are doing well The meeting will probably take place on Thursday |
For all supported Constituency labels users may consult Constituency Labels.
If constituent_type is omitted, the function returns the term as part of any constituent.
If the constituent label is specified, while the term arguments are omitted, the function matches all the constituents tagged by a specified label.
Example
The function also supports optional named arguments.
-
min_length / max_length / length:= length (in tokens) - specifies minimal, maximum or exact length of constituent.
-
level:=min/max - extracts either lower-level or higher-level constituents only; by default set to level:=max.
-
match:=range - extracts the whole constituent.
-
whole:=yes - extracts only the constituents contained in the query.
Example