This function extracts prepositions from a list of row and column labels. The list has outer structure of the number of labels and an inner structure of each prepositional phrase in the specific label.
get_prepositions(
labels,
inf_notation = TRUE,
notation = RCLabels::notations_list,
choose_most_specific = FALSE,
prepositions = RCLabels::prepositions_list
)
A list of prepositions.
The row and column labels from which prepositional phrases are to be extracted.
A boolean that tells whether to infer notation for x
.
Default is TRUE
.
See infer_notation()
for details.
The notation type to be used when extracting prepositions.
Default is RCLabels::notations_list
, meaning that
the notation is inferred using infer_notation()
.
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
.
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
.
get_prepositions(c("a [of b into c]", "d [-> e of f]"))
Run the code above in your browser using DataLab