This commit is contained in:
ayaka 2024-03-26 19:56:49 +13:00
parent 0633308ca1
commit 2a2f913b0e
2 changed files with 18 additions and 0 deletions

8
package.json Normal file
View File

@ -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
}

10
translate.js Normal file
View File

@ -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
)
}