View source: R/applied_reshape.r
split_UD_conj | R Documentation |
Split conjunctions for dependency trees in Universal Dependencies
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"), ... )
tokens |
a tokenIndex based on texts parsed with |
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. |
A tokenindex
tokens = tokens_spacy[tokens_spacy$doc_id == 'text5',] if (interactive()) { tokens %>% split_UD_conj() %>% plot_tree() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.