Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reselect_nodes

Within a chain of reshape operations, reapply the tquery


Description

Within a chain of reshape operations, reapply the tquery

Usage

reselect_nodes(.tokens)

Arguments

.tokens

A tokenIndex in which nodes are selected with select_nodes.

Value

A tokenIndex with a .nodes attribute

Examples

tokens = tokens_spacy[tokens_spacy$doc_id == 'text4',]

## use a tquery to label the nodes that you want to manipulate
tq = tquery(relation = "relcl", label = "relative_clause")

## apply query to select nodes
tokens2 = select_nodes(tokens, tq) 

## reuses the tq, that is stored in tokens2
## this makes it easy to make the selection anew after a transformation
tokens2 = reselect_nodes(tokens2)

rsyntax

Extract Semantic Relations from Text by Querying and Reshaping Syntax

v0.1.1
GPL-3
Authors
Kasper Welbers and Wouter van Atteveldt
Initial release
2020-10-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.