Created
November 6, 2012 11:38
-
-
Save jason-s13r/4024169 to your computer and use it in GitHub Desktop.
ghetto, based on xbot's !ghetto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ghetto = function(str, part) { | |
var gTable = ghettoTable; | |
return str.split(" ").map(function(T) { | |
function tr(U) { | |
return gTable[U.toLowerCase()] || U | |
} | |
if(part === true) { | |
return T.length < 5 ? T : T.substring(0, Math.ceil(T.length * 0.75)) + "-" + T.substring(Math.ceil(T.length * 0.75)).split("").map(tr).join("") | |
}else { | |
return T.split("").map(tr).join("") | |
} | |
}).join(" ") | |
}; | |
var ghettoTable = { | |
a: "sha", | |
b: "ni", | |
c: "ki", | |
d: "que", | |
e: "nay", | |
f: "qui", | |
g: "ti", | |
h: "la", | |
i: "kay", | |
j: "ri", | |
k: "barack", | |
l: "obama", | |
m: "di", | |
n: "ta", | |
o: "ee", | |
p: "ray", | |
q: "cli", | |
r: "gurl", | |
s: "na", | |
t: "qua", | |
u: "kwa", | |
v: "ise", | |
w: "fi", | |
x: "quee", | |
y: "mi", | |
z: "si" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment