Creating a hierplane object from text is made possible by employing the spacyr package. More specifically, the spacyr::spacy_parse() function is used to tokenize and tag the sentence(s) provided. Note that this functionality requires the spacyr package.

hp_spacyr(
  .data,
  node_type = "dep_",
  link = "dep_",
  attributes = spacyr_default_attributes(),
  styles = NULL,
  ...
)

Arguments

.data

A sentence.

node_type

spacyr::spacy_parse() variable to be used as node type (used for plane styling).

link

spacyr::spacy_parse() variable to be used to generate lane tags (i.e. connections between planes).

attributes

spacyr::spacy_parse() variable(s) to be used for generating the attribute tags. See full list of available attributes here:

styles

Assign styles to hierplane.

...

Additional parameters to pass to spacyr::spacy_parse()

Details

If more than one sentence is detected in the input text, a list of hierplane objects is returned.

Examples

if (FALSE) { # Custom attribute tags hp_spacyr("A house cat is genetically 95.6% tiger.", attributes = c("pos", "is_stop")) %>% hierplane() # Multiple sentences in input hp_spacyr("I have a cat. Her name is Mocha. She has a round belly.") %>% lapply(hierplane) }