# NOT RUN {
tokens = tokens_spacy[tokens_spacy$doc_id == 'text1',]
## use a tquery to label the nodes that you want to manipulate
tq = tquery(pos = 'VERB',
children(label = 'object', relation='dobj'))
## apply query to select nodes
tokens2 = select_nodes(tokens, tq)
remove_nodes(tokens2, 'object')
remove_nodes(tokens2, 'object', with_fill=FALSE)
# }
Run the code above in your browser using DataLab