Skip to content

Commit

Permalink
Clean up cat puns, Close #53
Browse files Browse the repository at this point in the history
  • Loading branch information
MergeCommits committed Dec 26, 2023
1 parent 63527b9 commit d3eb498
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 89 deletions.
11 changes: 9 additions & 2 deletions src/quirks/Quirk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@ export default abstract class Quirk {
this.quirkText += str;
}

protected replaceString(pattern: string, replace: string): void {
protected replaceString(
pattern: string,
replace: string | ((matched: string) => string)
): void {
const reg = new RegExp(pattern, "g");
this.quirkText = this.quirkText.replace(reg, replace);
if (typeof replace === "function") {
this.quirkText = this.quirkText.replace(reg, replace);
} else {
this.quirkText = this.quirkText.replace(reg, replace);
}
}

protected replaceCaseInsensitive(pattern: string, replace: string): void {
Expand Down
150 changes: 63 additions & 87 deletions src/quirks/canon/alternia/Nepeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,100 +18,76 @@ export default class Nepeta extends Quirk {
if (mods.puns) {
this.applyCatPuns();
}
this.replaceString("ee", "33");
this.replaceString("e{2,}", (matched) => "3".repeat(matched.length));
this.prefix(":33 < ");
}

protected applyCatPuns(): void {
this.replaceMatchCase("mother", "meowther");
this.replaceMatchCase("cause", "claws");
this.replaceMatchCase("now", "meow");
this.replaceMatchCase("afraid", "afuraid");
this.replaceMatchCase("ampora", "ampurra");
this.replaceMatchCase("amusement", "amewsment");
this.replaceMatchCase("approaches", "appurroaches");
this.replaceMatchCase("approve", "appurrve");
this.replaceMatchCase("awful", "pawful");
this.replaceMatchCase("because", "beclaws");
this.replaceMatchCase("cheater", "cheetah");
this.replaceMatchCase("complicated", "complickated");
this.replaceMatchCase("confident", "confurdent");
this.replaceMatchCase(
this.replaceWordMatchCase("afraid", "afuraid");
this.replaceWordMatchCase("ampora", "ampurra");
this.replaceWordMatchCase("amusement", "amewsment");
this.replaceWordMatchCase("approaches", "appurroaches");
this.replaceWordMatchCase("approve", "appurrve");
this.replaceWordMatchCase("awful", "pawful");
this.replaceWordMatchCase("because", "beclaws");
this.replaceWordMatchCase("cheater", "cheetah");
this.replaceWordMatchCase("complicated", "complickated");
this.replaceWordMatchCase("confident", "confurdent");
this.replaceWordMatchCase(
"councillor|counsellor|councilor|counselor",
"pouncellor"
);
this.replaceMatchCase("decapitate", "decapurrtate");
this.replaceMatchCase("departed", "depurrted");
this.replaceMatchCase("different", "diffurent");
this.replaceWordMatchCase("farewell", "furwell");
this.replaceWordMatchCase("frustrating", "furstrating");
this.replaceWordMatchCase("furious", "furrious");
this.replaceWordMatchCase("ferocious", "furrocious");
this.replaceWordMatchCase("hypocrite", "hypurrcrite");
this.replaceWordMatchCase("impolite", "impurrlite");
this.replaceWordMatchCase("important", "impurrtant");
this.replaceWordMatchCase("information", "infurmation");
this.replaceWordMatchCase("karkat", "karcat");
this.replaceWordMatchCase("kidding", "kitten");
this.replaceWordMatchCase("me", "t = meowt");
this.replaceWordMatchCase("decapitate", "decapurrtate");
this.replaceWordMatchCase("departed", "depurrted");
this.replaceWordMatchCase("different", "diffurent");
this.replaceWordMatchCase("metaphorical", "metafurkitty");
this.replaceWordMatchCase("muscular", "meowscular");
this.replaceWordMatchCase("nap", "catnap");
this.replaceWordMatchCase("opportunity", "opurrtunity");
this.replaceWordMatchCase("particular", "purrticular");
this.replaceWordMatchCase("pause", "paws");
this.replaceWordMatchCase("pearl", "purrl");
this.replaceWordMatchCase("protection", "purrtection");
this.replaceWordMatchCase("politics", "pawlitics");
this.replaceWordMatchCase("ponder", "pawnder");
this.replaceWordMatchCase("position", "purrsition");
this.replaceWordMatchCase("positive", "pawsitive");
this.replaceWordMatchCase("possible", "pawsible");
this.replaceWordMatchCase("posthaste", "scratching-posthaste");
this.replaceWordMatchCase("powers", "pawers");
this.replaceWordMatchCase("procrastinating", "purrcastinating");
this.replaceWordMatchCase("pronounce", "purrnounce");
this.replaceWordMatchCase("provoke", "purrvoke");
this.replaceWordMatchCase("pursed", "purrsed");
this.replaceWordMatchCase("reference", "refurence");
this.replaceWordMatchCase("referring", "refurring");
this.replaceWordMatchCase("risk", "frisk");
this.replaceWordMatchCase("scamper", "scampurr");
this.replaceWordMatchCase("talking", "stalking");
this.replaceWordMatchCase("telepathy", "telepurrthy");
this.replaceWordMatchCase("transfer", "transfur");
this.replaceWordMatchCase("transparent", "transpurrent");
this.replaceWordMatchCase("unfortunately", "unfurtunately");
this.replaceWordMatchCase("unresponsive", "unrespawsive");
this.replaceWordMatchCase("vriska", "friska");
this.replaceWordMatchCase("whimper", "whimpurr");
this.replaceWordMatchCase("whisper", "whisker");

this.replaceMatchCase("mother", "meowther");
this.replaceMatchCase("cause", "claws");
this.replaceMatchCase("now", "meow");
this.replaceMatchCase("far|for", "fur");
this.replaceMatchCase("farewell", "furwell");
this.replaceMatchCase("forbid", "furbid");
this.replaceMatchCase("forget", "furget");
this.replaceMatchCase("forgive", "furgive");
this.replaceMatchCase("fortify", "furtify");
this.replaceMatchCase("forward", "furward");
this.replaceMatchCase("frustrating", "furstrating");
this.replaceMatchCase("furious", "furrious");
this.replaceMatchCase("ferocious", "furrocious");
this.replaceMatchCase("hypocrite", "hypurrcrite");
this.replaceMatchCase("impolite", "impurrlite");
this.replaceMatchCase("important", "impurrtant");
this.replaceMatchCase("information", "infurmation");
this.replaceMatchCase("karkat", "karcat");
this.replaceMatchCase("kidding", "kitten");
this.replaceMatchCase("me", "t = meowt");
this.replaceMatchCase("metaphorical", "metafurkitty");
this.replaceMatchCase("muscular", "meowscular");
this.replaceMatchCase("nap", "catnap");
this.replaceMatchCase("opportunity", "opurrtunity");
this.replaceMatchCase("particular", "purrticular");
this.replaceMatchCase("pause", "paws");
this.replaceMatchCase("pearl", "purrl");
this.replaceMatchCase("per", "purr");
this.replaceMatchCase("percent", "purrcent");
this.replaceMatchCase("perchance", "purrchance");
this.replaceMatchCase("perfect", "purrfect");
this.replaceMatchCase("perhaps", "purrhaps");
this.replaceMatchCase("perk", "purrk");
this.replaceMatchCase("permission", "purrmission");
this.replaceMatchCase("perplex", "purrplex");
this.replaceMatchCase("preposterous", "purrpawsterous");
this.replaceMatchCase("persevere", "purrsevere");
this.replaceMatchCase("persnickety", "purrsnickety");
this.replaceMatchCase("person", "purrson");
this.replaceMatchCase("personality", "purrsonality");
this.replaceMatchCase("protection", "purrtection");
this.replaceMatchCase("pretend", "purrtend");
this.replaceMatchCase("perturb", "purrturb");
this.replaceMatchCase("pervert", "purrvert");
this.replaceMatchCase("politics", "pawlitics");
this.replaceMatchCase("ponder", "pawnder");
this.replaceMatchCase("position", "purrsition");
this.replaceMatchCase("positive", "pawsitive");
this.replaceMatchCase("possible", "pawsible");
this.replaceMatchCase("posthaste", "scratching-posthaste");
this.replaceMatchCase("powers", "pawers");
this.replaceMatchCase("precious", "purrcious");
this.replaceMatchCase("prefer", "purrfur");
this.replaceMatchCase("preform", "purrform");
this.replaceMatchCase("prepared", "prepurred");
this.replaceMatchCase("pretty", "purrty");
this.replaceMatchCase("procrastinating", "purrcastinating");
this.replaceMatchCase("pronounce", "purrnounce");
this.replaceMatchCase("provoke", "purrvoke");
this.replaceMatchCase("pursed", "purrsed");
this.replaceMatchCase("reference", "refurence");
this.replaceMatchCase("referring", "refurring");
this.replaceMatchCase("risk", "frisk");
this.replaceMatchCase("scamper", "scampurr");
this.replaceMatchCase("talking", "stalking");
this.replaceMatchCase("telepathy", "telepurrthy");
this.replaceMatchCase("transfer", "transfur");
this.replaceMatchCase("transparent", "transpurrent");
this.replaceMatchCase("unfortunately", "unfurtunately");
this.replaceMatchCase("unresponsive", "unrespawsive");
this.replaceMatchCase("vriska", "friska");
this.replaceMatchCase("whimper", "whimpurr");
this.replaceMatchCase("whisper", "whisker");
this.replaceMatchCase("per|pre|par", "purr");
}
}

0 comments on commit d3eb498

Please sign in to comment.