bartleby.util

Internal API for shared functions, like name manipulation

author->lastnames

(author->lastnames fullnames)
Get last names from BibTeX-formatted author string fullnames

collapse-space

(collapse-space s)
Replace all sequences of whitespace in s with a single space

format-names

(format-names names)
Join a collection of (last-)names as they would naturally be formatted.
[A]         ->   A
[A, B]      ->   A and B
[A, B, C]   ->   A, B and C (no Oxford comma)

map-values

(map-values f kvs)
Contruct a new map with all the values of the map kvs passed through f

normalize-nfc

(normalize-nfc s)
NFC-normalize the string s

re-escape

(re-escape s)
Escape any regular expression syntax characters in s such that the result can be
embedded in a regular expression, but will only match literally equivalent strings.

split-fullname

(split-fullname fullname)
Parse the string fullname into a vector of [given-names surname],
or just [given-names] if no surname is given.