What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Slang Replacer

Pages: (2): « First [ 1 ] 2 » Last »
Slang Replacer
Author: Message:
stuartbennett
Senior Member
****

Avatar

Posts: 952
Reputation: 1
43 / Male / Flag
Joined: Nov 2003
O.P. Slang Replacer
i tryed slang replacer today and found a minor glitch with it for example typing the word "Breakfast" results in "Best Regardseakfast" its only a few minor things like that if someone can program some logic into it so it know when something is slang and when something is part of a proper word thatd be cool.
07-16-2006 09:11 AM
Profile E-Mail PM Web Find Quote Report
fish-luke
New Member
*


Posts: 12
Joined: Jul 2006
RE: Slang Replacer
well that script is designed to do that, however it doesn't work for other slang words eg BRB. I guess that if it bothers you too much, you will just have to delete the script...:S
07-16-2006 04:45 PM
Profile E-Mail PM Find Quote Report
4penguino
Banned


Posts: 85
Reputation: -13
Joined: Jul 2006
RE: Slang Replacer
there are many glitches im=instant message and bro=bestreguardso its br which stands 4 best reguardso or summat like that and 2 get around that u have 2 put Bro or I'm its very um............confused
07-16-2006 04:49 PM
Profile E-Mail PM Find Quote Report
stuartbennett
Senior Member
****

Avatar

Posts: 952
Reputation: 1
43 / Male / Flag
Joined: Nov 2003
O.P. RE: Slang Replacer
isnt there a way to tell the program that if say a letter is directly after the supposid slang then its a word but if its a space after the slang then translate it? i can understand that im=instant message and i dont mind having to type it gramatically correct "i'm" but breakfast being translated wrongly just seems stupid. i have stopped the svript from running for now but would hope the glitch is fixable maybe not immediately but eventually.
07-16-2006 05:19 PM
Profile E-Mail PM Web Find Quote Report
Keikonium
Full Member
***


Posts: 229
Reputation: 3
35 / Male / Flag
Joined: Jul 2006
RE: Slang Replacer
Most people have semi good grammar, so this should be a nice little fix. When you type, you usually use spaces. Ex:

Bob says:
Hey John, I g2g, hospital time... :(
---> Hey John, I got to go, hospital time... :(

John says:
Okay, br buddy :)
---> Okay, best reguards buddy :)

So, a simple fix would be instead of:

sMessage = sMessage.replace(/br/gi,"best reguards");
make it
sMessage = sMessage.replace(/ br /gi," best reguards ");

:). Notice the space. This wont catch "br" at the end of a sentance however. But if you put an extra space at the end, it'll catch it ;).

This is how I wrote my personal script anyway.
Now Playing:
[image not working] [Image: 87cc21b0.png]
07-16-2006 06:16 PM
Profile E-Mail PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: Slang Replacer
Split the input message by a space and loop through each element. Check each element in turn to see if it matches a pre-defined list of known 'slang' words. (For bonus points strip punctuation out of it and preserve it later on!) If it does, replace that array element with a replacement (figure out an associative array or somesuch for it, else use a txt file, far better). Join the array back together by spaces and send it.

This post was edited on 07-16-2006 at 10:06 PM by segosa.
The previous sentence is false. The following sentence is true.
07-16-2006 09:57 PM
Profile PM Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: Slang Replacer
quote:
Originally posted by Keikonium
So, a simple fix would be instead of:
code:
sMessage = sMessage.replace(/br/gi,"best reguards");
make it
sMessage = sMessage.replace(/ br /gi," best reguards ");



I think this would be even better:
code:
/(^|\s+)br($|\s+)/igm

And indeed use segosa's idea for the checking method
[Image: 1-0.png]
             
07-16-2006 10:20 PM
Profile PM Web Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Slang Replacer
Hmm wouldn't this be better?
code:
/\bbr\b/mgi

Doesn't need to check if its at the begining or not or space character as it looks for word boundries, And works with punctuation. Plus it doesn't chop out the space.

Also the writer should have did a spell check. Regards is not spelled reguards.

This post was edited on 07-16-2006 at 11:25 PM by Silentdragon.
07-16-2006 11:11 PM
Profile E-Mail PM Web Find Quote Report
Keikonium
Full Member
***


Posts: 229
Reputation: 3
35 / Male / Flag
Joined: Jul 2006
RE: Slang Replacer
Wow, your methods look so much better than mine did, and it looks to work like mine doesn't :D.

May I ask a question... The /*letter*.. I only know of:

/i = doesn't look for uppser/lowercase?
/g = no idea... found it in some code :S.

What are all the /*letters* that you can use, and what do they do. I looked thru the documentation breifly, but didn't see anything about this (probably missed it).

And what are the $, +, and | for :S? Is there a place that can tell me all this. Sorry to be such a noob :$ lol.
Now Playing:
[image not working] [Image: 87cc21b0.png]
07-16-2006 11:45 PM
Profile E-Mail PM Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
RE: Slang Replacer
They are called regular expressions. Here is more info:
http://authors.aspalliance.com/wsk/aboutregularexpression.asp
[Image: clb2.jpg]
07-16-2006 11:50 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On