From 2a2f913b0ec49a09bed9ddcfafeed24172975da8 Mon Sep 17 00:00:00 2001 From: ayaka Date: Tue, 26 Mar 2024 19:56:49 +1300 Subject: [PATCH] init --- package.json | 8 ++++++++ translate.js | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 package.json create mode 100644 translate.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..5470dfa --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "mse-translator", + "version": "1.0.0", + "description": "Maoist Standard English Translator", + "main": "translate.js", + "license": "GPLv3-or-later", + "private": true +} diff --git a/translate.js b/translate.js new file mode 100644 index 0000000..f8fc28b --- /dev/null +++ b/translate.js @@ -0,0 +1,10 @@ +module.exports.translate = (string, options) => { + return(string + .replace(/ss/gi, "\$\$\$") // Only 2 ss to $ + .replace(/s/gi, "SS") // Singular s to SS + .replace(/k/gi, "KKK") // K + .replace(/\bcan/gi, "KKKlan") // Klan + .replace(/c(?![heiy])/gi, "KKK") // Replace c's that will sound like /k/ + .replace(/kkkkkk/gi, "KKK") //shorten ck, kk and cc + ) +}