import Uwuifier from "uwuifier"; export function uwuify(input: string) { const uwuifier = new Uwuifier(); const uwuifiedContent = input ? uwuifier.uwuifySentence(input) : ""; const blacklistedWords = ["twerks", "sees bulge", "notices buldge", "starts twerking", "wank"]; return blacklistedWords.reduce((acc, word) => { return acc.replace(new RegExp(word, "gi"), "mrrp"); }, uwuifiedContent); } export function glorpify(input: string): string { if (!input) return ""; const slang: Record = { hello: "zeep zorp", hi: "meep", cat: "gnarp", dog: "glorb", human: "geeble", person: "geeble", people: "geebles", what: "what the glorp", cool: "bogos binted", awesome: "bogos binted", alien: "glorp", aliens: "glorps", }; const vowelMap: Record = { a: "arp", e: "eep", i: "ip", o: "orp", u: "oop", A: "Arp", E: "Eep", I: "Ip", O: "Orp", U: "Oop", }; const glorpifyWord = (word: string): string => { const lower = word.toLowerCase(); const isWordUppercase = word === word.toUpperCase(); if (slang[lower] !== undefined) { const replacement = slang[lower]; if (isWordUppercase) return replacement.toUpperCase(); if (word[0] === word[0]?.toUpperCase()) return replacement.charAt(0).toUpperCase() + replacement.slice(1); return replacement; } return word.replace(/[aeiouAEIOU]+/g, (match) => { const firstChar = match[0]; const replacement = firstChar ? vowelMap[firstChar] || match : match; if (isWordUppercase) return replacement.toUpperCase(); return replacement; }); }; const tokens = input.match(/\w+|[^\w]+/g) || []; let glorpifiedContent = tokens .map((token) => (/^\w+$/.test(token) ? glorpifyWord(token) : token)) .join(""); const suffixes = [ "glorp", "gnarp gnarp", "gleep glorp", "zeep zorp", "meep mop", "geeble", "bogos binted", ]; if (Math.random() < 0.3) { const randomSuffix = suffixes[Math.floor(Math.random() * suffixes.length)]; const cleanEnd = glorpifiedContent.replace(/[.!?,]+$/, ""); const punctuation = glorpifiedContent.slice(cleanEnd.length) || "!"; glorpifiedContent = `${cleanEnd} ...${randomSuffix}${punctuation}`; } return glorpifiedContent; }