annotate_nodes: Annotate a tokenlist based on rsyntaxNodes

Description Usage Arguments

View source: R/annotate.r

Description

Use rsyntaxNodes, as created with tquery and apply_queries, to annotate a tokenlist. Two columns will be added. One column contains the ids for each hit. The other column contains the annotations. Only nodes that are given a name in the tquery (using the 'label' parameter) will be added as annotation.

Usage

1
annotate_nodes(tokens, nodes, column)

Arguments

tokens

A tokenIndex data.table, or any data.frame coercible with as_tokenindex.

nodes

A data.table, as created with find_nodes or apply_queries. Can be a list of multiple data.tables.

column

The name of the column in which the annotations are added. The unique ids are added as [column]_id


vanatteveldt/rsyntax documentation built on Nov. 27, 2018, 11:29 p.m.