User:Monkbot/Task 5: CS1 deprecated coauthor parameters

Monkbot task 5 is a variant of the task 2 script. Like task 2, it is intended to pluck some of the low hanging fruit from Category:Pages containing cite templates with deprecated parameters.

This script replaces the deprecated Citation Style 1 parameters |coauthor= and |coauthors= (hereafter |coauthor=) with individual |authorn= parameters where n is a number 2–10. Task 5 operates on CS1 citations that have |coauthor= parameters that are lists of comma separated names where the names are in first-middle-last order.

Generally names in the |coauthor= parameter must have this form:

First Middle Middle Last
where First and Middle may be initials and may be followed by a period and where Middle is optional

The script has a one-way overlap with task 3. Task 5 can fix |coauthor= parameters where the list of names is comma separated Vancouver style. Task 5 cannot fix Vancouver style names where Last is hyphenated or contains an apostrophe, nor when the last initial is followed by a period (Last FM.). Task 3 cannot fix First-Middle-Last form names.

All or part of the last name in a multiname |coauthor= list may be et al (without terminal period), for example: First Last et al (a terminal period will not match because last names aren't typically terminated with a period).

When |coauthor= has only a single name, the script uses the same rule as task 2.

Task 5 will not change citations:

  • that have |ref=harv, which includes all {{citation}} templates because {{citation}} sets |ref=harv by default
  • where |coauthor= precedes |last=, |last1=, |author=, or |author1=
  • that contain |lastn= or |authorn= where n is greater than 1

Beyond the exceptions noted in §Ancillary tasks, task 5 does not evaluate, modify, or remove parameter values.