# NOT RUN {
## spacy tokens for: Mary loves John, and Mary was loved by John
tokens = tokens_spacy[tokens_spacy$doc_id == 'text3',]
## two simple example tqueries
passive = tquery(pos = "VERB*", label = "predicate",
children(relation = c("agent"), label = "subject"))
active = tquery(pos = "VERB*", label = "predicate",
children(relation = c("nsubj", "nsubjpass"), label = "subject"))
# }
# NOT RUN {
tokens = annotate_tqueries(tokens, "clause", pas=passive, act=active)
tokens
if (interactive()) plot_tree(tokens, annotation='clause')
# }
Run the code above in your browser using DataLab