Next / Previous / Contents / Shipman's homepage

10.2. Utility functions

abbreviate(eng)

Abbreviates an English name according to the rules of the system. Takes a string containing a name either in the usual word order (e.g., "Aztec Thrush") or in “last, first” order (e.g., "Amakihi, Molokai").

fixAbbr(abbr)

Returns a normalized bird code: the argument is uppercased and right-padded with spaces to the maximum code length.

commaSplit(eng)

Splits an inverted name and returns returns a tuple (G, S).

  • If eng contains no comma, G will be equal to eng and S will be an empty string.

  • If eng contains a comma, G will be the part after the first comma (less any leading or trailing whitespace), and S will be everything up to (but not including) the first comma.

engComma(eng)

Given an English name in the customary order, such as “American Robin”, returns it in the inverted form, e.g., “Robin, American”.

engDeComma(eng)

Given an English name in the inverted form, such as “Robin, American”, returns the customary form, e.g., “American Robin”.