> <s> [pos = "VBG"];
> [pos = "VBG"] [pos = "SENT"]? </s>;
present participle at start or end of sentence
> <np> []* ([pos="JJ.*"] []*){3,} </np>;
NP containing at least 3 adverbs
(when StrictRegions are switched off, XML tags match any region boundaries and may skip intervening boundaries as well as material outside the corresponding regions)
/region[np];
<np> []* </np>;
> <s><np>[]*</np> []* <np>[]*</np></s>;
sentence that starts and ends with a noun phrase (NP)
> [(pos = "NNS?") & !np];
noun that is not contained in a noun phrase (NP)
> [(pos = "VBG") & lbound(s)];
present participle at start of sentence
lbound_of()
and
rbound_of()
return the corpus positions of the start/end of a region.
Because of technical limitations, the anchor position has to be specified
explicitly as a second argument, which will often be the this label:
> [(word = "\d+") & (lbound_of(s, _) = lbound_of(chapter, _))];
a number in the first sentence of a chapter
The same query could also be written with an explicit label or anchor reference in a global constraint (which is perhaps easier to read):
> "\d+" :: lbound_of(s, match) = lbound_of(chapter, match);
If the referenced position is not contained in a suitable s-attribute region, the functions return an undefined value, which evaluates to false in most contexts (in particular, all comparisons with this value will be false).
lbound_of()
and rbound_of()
functions are mainly used
in connection with distance() or distabs(). For example,
to find occurrences of the word end within the first 40 tokens of a chapter:
> [word = "end"%c & distabs(_, lbound_of(chapter, _)) < 40];
> [pos="NN"] []* [pos="NN"] within np;
sequence of two singular nouns within the same NP
> A = [pos="JJ.*"] ([]* [pos="JJ.*"]){2} within np;
> B = A expand to np;
one-sided expansion is selected with the optional left or right keyword
> C = B expand left to s;
> [pos="JJ.*"] ([]* [pos="JJ.*"]){2} within np cut 20 expand to np;