What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with a text output script

Help with a text output script
Author: Message:
Stapleman
New Member
*


Posts: 2
Joined: Jun 2007
O.P. Help with a text output script
Hello! After having recently seen A Clockwork Orange I decided to try a script that outputs English in Nadsat.

However, I'm having some trouble.

For example, typing out "brain" gives "mozg." But when typing out "brains" I should get "mozggies," however, it only outputs "mozgs."

I think this is because the code recognizes "brain" before "brains."

My question is, is there a way to bypass this?
06-27-2007 08:26 PM
Profile E-Mail PM Find Quote Report
AngelDevil
Full Member
***

Avatar
MsgPlus! Script Developer

Posts: 175
34 / Male / Flag
Joined: Jun 2007
RE: Help with a text output script
Use "brain " (with the space at the end), and the code doesn't recognize "brains" as "brain" + "s"...
http://www.amicogeek.it - Technology blog!
06-27-2007 08:30 PM
Profile PM Find Quote Report
Stapleman
New Member
*


Posts: 2
Joined: Jun 2007
O.P. RE: Help with a text output script
Many thanks!
06-27-2007 08:39 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Help with a text output script
Or look for the plural of the word first. 8-)
06-27-2007 08:56 PM
Profile E-Mail 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: Help with a text output script
Or if you are using regular expressions use word boundaries.
[Image: 1-0.png]
             
06-27-2007 09:04 PM
Profile PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
34 / Male / Flag
Joined: Oct 2004
RE: Help with a text output script
quote:
Originally posted by AngelDevil
Use "brain " (with the space at the end), and the code doesn't recognize "brains" as "brain" + "s"...
That's not exactly the wisest thing to do, there are many times when you're going to have the word at the end of a sentence (with a period following) or at the end of the message (with nothing following) and it won't be picked up through this method.

A better alternative is to split the message up into words using .split(" ") and then stripping trailing and preceding punctuation and translating the resultant word (or leaving it the same if there's no translation).

This post was edited on 06-28-2007 at 03:49 AM by Volv.
06-28-2007 03:49 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Help with a text output script
quote:
Originally posted by Matty
Or look for the plural of the word first. 8-)
And that's the smartest and easiest thing to do! Guaranteed success! ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-28-2007 07:59 AM
Profile E-Mail PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Help with a text output script
quote:
Originally posted by Mattike
quote:
Originally posted by Matty
Or look for the plural of the word first. 8-)
And that's the smartest and easiest thing to do! Guaranteed success! ;)

Incorrect, "Guaranteed success!" comes from Ezra's method.

quote:
Originally posted by Ezra
Or if you are using regular expressions use word boundaries.

That way if you use any other prefix or suffix or use it within another word (like "hi" is in "this" for example) then it will not replace it.  This is "Guaranteed success!" ;)
[Image: markee.png]
06-28-2007 09:43 AM
Profile PM Find Quote Report
« 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