get_pps: Extract prepositional phrases of row and column labels

View source: R/extractors.R

get_ppsR Documentation

Extract prepositional phrases of row and column labels

Description

This function extracts prepositional phrases from suffixes of row and column labels of the form "a [preposition b]", where "preposition b" is the prepositional phrase.

Usage

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

Arguments

labels

A list or vector of 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 prepositional phrases. 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 list of prepositions for which to search. Default is RCLabels::prepositions_list.

Value

All prepositional phrases in a suffix.

Examples

get_pps(c("a [in b]", "c [of d]"))
get_pps(c("a [of b in c]", "d [-> e of f]"))

RCLabels documentation built on April 25, 2023, 5:11 p.m.