get_objects: Extract objects of prepositional phrases in row and column...

View source: R/extractors.R

get_objectsR Documentation

Extract objects of prepositional phrases in row and column labels

Description

This function extracts the objects of prepositional phrases from row and column labels. The format of the output is a list of named items, one name for each preposition encountered in labels. Objects are NA if there is no prepositional phrase starting with that preposition.

Usage

get_objects(
  labels,
  inf_notation = TRUE,
  notation = RCLabels::notations_list,
  choose_most_specific = FALSE,
  prepositions = RCLabels::prepositions_list
)

Arguments

labels

The row and column labels from which prepositional phrases are to be extracted.

inf_notation

A boolean that tells whether to infer notation for x. Default is TRUE. See infer_notation() for details.

notation

The notation type to be used when extracting prepositions. Default is RCLabels::notations_list, meaning that the notation is inferred using infer_notation().

choose_most_specific

A boolean that tells whether to choose the most specific notation from notation when inferring notation. Default is FALSE so that a less specific notation can be inferred. In combination with RCLabels::notations_list, the default value of FALSE means that RCLabels::bracket_notation will be selected instead of anything more specific, such as RCLabels::from_notation.

prepositions

A vector of strings to be treated as prepositions. Note that a space is appended to each word internally, so, e.g., "to" becomes "to ". Default is RCLabels::prepositions_list.

Value

A list of objects of prepositional phrases, with names being prepositions, and values being objects.

Examples

get_objects(c("a [of b into c]", "d [of Coal from e -> f]"))

RCLabels documentation built on May 29, 2024, 5:56 a.m.