Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I need help manipulating chain text

Cris Poliak
Registered User
Join date: 14 Apr 2008
Posts: 27
06-01-2009 08:37
Hello, I want to write the complete name of a visitor in a XyzzyText prim using that library or just the XyText one.

My problem is that the SecondLife names are allowed to 31 characters maximum (it also applies for the last names)
Since the maximum allowed characters for the XyzzyText library is 10, how can I write the SLName and SLLastName using 2 prims? Any ideas to abbreviate them?

I would like to know how to get something like this:
i.e.: The avatar name would be ''ASecondLife VisitorInThisLand" (29 characters) and I would like to get in that 2 prims this text: "ASec. Visitor." (15 characters)

Any ideas to do it? I don't want help to send the characters to the XyText prim, just the way to do it with a simply code manipulating chain text.

Thanks in advance.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-01-2009 09:21
The algorithm you are looking for is actually patented, which is one reason you don't see many applications auto-abbreviating text. It's a perfect example of the insanity that is software patents. The algorithm is basically "remove all vowels, remove all doubled letters, remove [list of dipthongs]" until length < required.

Removing vowels in LSL can be done by (string)llParseString2List(string, ["a", "e", "i", "o", "u"], []);
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Cris Poliak
Registered User
Join date: 14 Apr 2008
Posts: 27
06-01-2009 09:59
From: Argent Stonecutter
The algorithm you are looking for is actually patented.


Does it mean that I cannot do it by myself? :S
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-01-2009 10:30
It means that if you're someone like Apple or Microsoft you'll get sued for using it. Are you secretly Apple or Microsoft?
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Cris Poliak
Registered User
Join date: 14 Apr 2008
Posts: 27
06-01-2009 14:09
From: Argent Stonecutter
It means that if you're someone like Apple or Microsoft you'll get sued for using it. Are you secretly Apple or Microsoft?


lol of course I am not, I am an usual user. Just like another.. And I'm only asking the way to cut a long string. I don't want even to create a library to do that or reverse-engineering an existent (When I was refering to a library it only was XyText and the other one that I don't remember) I am familiarized with XyText, but not with string manipulation using LSL.

If you mean that I was not clear when I made the question, I'll say it using another words:

Does anybody know how to cut a long word using a LSL function?

ThisIsALongName ----> ThisIs.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-01-2009 14:12
From: Cris Poliak
Does anybody know how to cut a long word using a LSL function?

ThisIsALongName ----> ThisIs.
http://wiki.secondlife.com/wiki/LlGetSubString
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Cris Poliak
Registered User
Join date: 14 Apr 2008
Posts: 27
06-01-2009 14:25
Thank you very much dude, that's what I was looking for.