# NOT RUN {
tokens = tokens_spacy[tokens_spacy$doc_id == 'text4',]
## custom fill rule that ignores relative clauses
no_relcl_fill = custom_fill(BREAK(relation='relcl'))
## add custom fill as argument in children(). NOTE that it should be
## passed as an unnamed argument (and not to the fill boolean argument)
tq = tquery(label = 'verb', pos='VERB', fill=FALSE,
children(label = 'subject', relation = 'nsubj', no_relcl_fill),
children(label = 'object', relation = 'dobj', no_relcl_fill))
tokens = annotate_tqueries(tokens, "clause", tq)
tokens
# }
Run the code above in your browser using DataLab