strip_subject_relation: Remove relational phrases from subject headings

Description Usage Arguments Value Examples

Description

Many subject headings specify a relation to a term: not just "Joyce, James" but "compared to Joyce, James." For aggregating purposes, these relations can often be ignored. This function attempts to remove any number of these relational phrases found at the start of a term, leaving only the main terms. Subheadings (delimited by a colon) are also removed.

Usage

1
strip_subject_relation(x, rels = getOption("mlaibr.relations"))

Arguments

x

character vector of headings

rels

character vector of regular expressions matching relation terms. The anchor ^ is added at the start, a space is added to the end of each term, and then the vector is collapsed using the alternator | as a separator. One or more occurrences of this big pattern are removed. A default list is set as package option mlaibr.relations, but this was found by trial and error and may need modification.

Value

the headings with relation terms removed (hopefully)

Examples

1
2
3
4
strip_subject_relation("sources in James, William (1842-1910)")
strip_subject_relation("compared to Wordsworth, William (1770-1850): 'Intimations of Immortality from Recollections of Early Childhood'")

strip_subject_relation("discusses theories of relationship to realism")

agoldst/mlaibr documentation built on May 10, 2019, 7:34 a.m.