split_UD_conj: Split conjunctions for dependency trees in Universal...

View source: R/applied_reshape.r

split_UD_conjR Documentation

Split conjunctions for dependency trees in Universal Dependencies

Description

Split conjunctions for dependency trees in Universal Dependencies

Usage

split_UD_conj(
  tokens,
  conj_rel = "conj",
  cc_rel = c("cc", "cc:preconj"),
  unpack = T,
  no_fill = NULL,
  min_dist = 0,
  max_dist = Inf,
  right_fill_dist = T,
  compound_rel = c("compound*", "flat"),
  ...
)

Arguments

tokens

a tokenIndex based on texts parsed with spacy_parse (with dependency=TRUE)

conj_rel

The dependency relation for conjunctions. By default conj

cc_rel

The dependency relation for the coordinating conjunction. By default cc. This will be removed.

unpack

If TRUE (default), create separate branches for the parent and the node that inherits the parent position

no_fill

Optionally, a character vector with relation types that will be excluded from fill

min_dist

Optionally, a minimal distance between the conj node and its parent

max_dist

Optionally, a maximum distance between the conj node and its parent

right_fill_dist

Should fill to the right of the conjunction be used?

compound_rel

The relation types indicating compounds

...

specify conditions for the conjunction token. For instance, using 'pos = "VERB"' to only split VERB conjunctions. This is especially usefull to use different no_fill conditions.

Value

A tokenindex

Examples

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

if (interactive()) {
tokens %>%
   split_UD_conj() %>%
   plot_tree()
}

rsyntax documentation built on June 7, 2022, 9:07 a.m.