From 5d9a031c02e36807b654bf86eeb2e6e8da751c99 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sat, 26 Dec 2020 15:35:31 -0500 Subject: [PATCH] De-capitalize "giants" but capitalize "X Giant" --- lib/convert-worker.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/convert-worker.js b/lib/convert-worker.js index 1e3558b..390deac 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -497,23 +497,23 @@ function fixCapitalization(xml, book) { xml = xml.replace(/the birdcage/g, "the Birdcage"); // There's no reason why these should be capitalized. - xml = xml.replace(/(?)Halberd/g, "halberd"); + xml = xml.replace(/(?)Loft/g, "loft"); // These are treated as common nouns and not traditionally capitalized. "Krav Maga" remains capitalized, // interestingly (according to dictionaries and Wikipedia). - xml = xml.replace(/(?)Judo/g, "judo"); + xml = xml.replace(/(?)Aikido/g, "aikido"); + xml = xml.replace(/(?)Karate/g, "karate"); + xml = xml.replace(/(?)Tae Kwon Do/g, "tae kwon do"); // There's no reason why university should be capitalized in most contexts, although sometimes it's used as part of // a compound noun or at the beginning of a sentence. - xml = xml.replace(/(?|Cornell |Nilles )University(?! Road)/, "university"); // Organ names (e.g. brain, arm) or scientific names are not capitalized, so the "corona pollentia" and friends should // not be either. The books are inconsistent. - xml = xml.replace(/(?|-)Corona/g, "corona"); xml = xml.replace(/Pollentia/g, "pollentia"); xml = xml.replace(/Radiata/g, "radiata"); xml = xml.replace(/Gemma/g, "gemma"); @@ -521,7 +521,7 @@ function fixCapitalization(xml, book) { // We de-capitalize Valkyrie's "flock", since most uses are de-capitalized (e.g. the many instances in Gleaming // Interlude 9, or Dying 15.z). This is a bit surprising; it seems like an organization name. But I guess it's // informal. - xml = xml.replace(/(?)Flock/g, "flock"); // Especially early in Worm, PRT designations are capitalized; they should not be. This fixes the cases where we // can be reasonably sure they don't start a sentence, although more specific instances are done in @@ -533,7 +533,7 @@ function fixCapitalization(xml, book) { // This also over-de-capitalizes "The Stranger" in Ward (a titan name). Those also get fixed in substitutions.json. xml = xml.replace( // eslint-disable-next-line max-len - /(?|“|\n|: )(Mover|Shaker|Brute|Breaker|Tinker|Blaster|Thinker|Striker|Changer|Trump|Stranger|Shifter|Shaper)(?! [A-Z])/g, + /(?|\n|: )(Mover|Shaker|Brute|Breaker|Tinker|Blaster|Thinker|Striker|Changer|Trump|Stranger|Shifter|Shaper)(?! [A-Z])/g, (_, designation) => designation.toLowerCase() ); xml = xml.replace( @@ -610,6 +610,11 @@ function fixCapitalization(xml, book) { xml = xml.replace(/Kronos titan/g, "Kronos Titan"); } + // For the giants, the prevailing usage seems to be to keep the term lowercase, but capitalize when used as a name. + xml = xml.replace(/(?<=Mathers |Goddess )giant/g, "Giant"); + xml = xml.replace(/mother giant/ig, "Mother Giant"); + xml = xml.replace(/(?)Giants/g, "giants"); + return xml; }