Page 1 of 1

Net Speak Translator

Posted: August 23rd, 2004, 5:11 pm
by AmaD
OK, this script should translate all that net speak that some find undecipherable and others just annoying - like 'rotfl' 'lol' 'ur' and so on. This small script should work if you just bung it into notepad and save it as somthing.html. ONLY use in Internet Explorer, not firefox or other browsers as i'm such an idiot that i can't make it compatible with others. I guess all that script blocking stuff...

Anyway

Code: Select all


<html>
<head>
<title> Online Speak Translator </title>

<script>

var replwords = "u:you,g2g:got to go,brb:be right back,gtg:got to go,nite:night,2nite:tonight,omg:oh my god,k:ok,wtf:what the f*ck,mj:micheal jackson,lmao:laughing my ass off,rotfl:rolling on the floor laughing,imo:in my opinion,imho:in my humble opinion,r:are,2:to,da:the,ufie:youth club,ur:you are,hed:head,goin:going,";
var replarray = replwords.split(",");
var slangversion = new Array();
var correctversion = new Array();
for( i=0; i<replarray.length; i++ ){
var thiswordsplit = replarray[i].split(":");
slangversion[i] = thiswordsplit[0];
correctversion[i] = thiswordsplit[1];
}

window.resizeTo(519,647);

function write_entry()
{

var intext = f.value;
var intextwds = intext.split(" ");
var outtext = "";

for( w=0; w<intextwds.length; w++ ){
var intextwc = intextwds[w].toLowerCase();
var corrected = false;

for( s=0; s<slangversion.length; s++ ){
if( intextwc == slangversion[s] ){
outtext = outtext + " " + correctversion[s];
corrected = true;
}
}

if( corrected ==  false ){
outtext = outtext + " " + intextwds[w];
}

}

f.value = outtext;
alert("Translation complete!");
}


</script>

</head>

<body bgcolor="orange">


<div id='lyr' style='position:absolute;top:0px;left:400px;width:90px;height:500px;z-index:-10;background-color:#FFCC00'></div>

<div id='lyr' style='position:absolute;top:0px;left:290px;width:70px;height:500px;z-index:-10;background-color:#FFCC00'></div>

<div id='lyr' style='position:absolute;top:0px;left:210px;width:50px;height:500px;z-index:-10;background-color:#FFCC00'></div>

<div id='lyr' style='position:absolute;top:410px;left:0px;width:400px;height:90px;z-index:-10;background-color:#FFCC00'></div>

<div id='lyr' style='position:absolute;top:0px;left:130px;width:30px;height:500px;z-index:-10;background-color:#FFCC00'></div>


<h3><font face="Arial"><span style="background-color: #FFCC00">Online Speak Translator</h3></font></span>

<textarea rows="17" name="f" cols="49"></textarea><p>
<input type="submit" value="Translate" name="B1" onclick="write_entry()">

</body>
</html>



Posted: August 24th, 2004, 3:22 pm
by Cibok
lol sounds cool, got a working demo!??
(too lazy to try out the script) ;)

Posted: September 3rd, 2004, 10:30 pm
by AmaD
Sorry, I'll try to get a domain as soon as possible