Sources list authors in one string, separated by newlines, commas,
semicolons, "and" or "&". split_author_string() returns one row per
name, with its position. Name suffixes split off by a comma
("John Smith, Jr.") are not counted as authors.
Usage
split_author_string(
doc_id,
authors,
pattern = "\\s*(\\n|,|;|\\band\\b|&)\\s*",
drop_prefix = "^\\s*by\\s+"
)Value
A data.table with doc_id, author_order and name_raw (the
name as written by the source; standardising names is a later step).
Details
Commas also separate surname and first name in some sources
("Smith, John"): check the format of a source before using the default
pattern, and pass a pattern without the comma if needed.
See also
Other normalisation:
collapse_or_na(),
escape_regex(),
na_if_sentinel(),
normalise_for_matching()