Text Spintax Module Available...

G

GCOINC

Guest
HEY YA'LL,

Currently doing some silly stuff like this >

B4X:
rndnames = Regex.Split("\|", "Jimmy|Jane|Jen|Jimbo|James|Janet|Hey Skunk|Hey Barzina")
rndname = rndnames(Rnd(1,rndnames.Length))


Is there a special someone out there who can lend a hand with a proper 'spintax' module or piece of codey goodness?

Sorry 'nested spintax' would be the boss!

Example of spintax here...
B4X:
{Hey|Yo|Good day|Btw|Hiya|Heya|Howdy|Whats up|Hello|Hi|Guess what|Sup|} {Chung|Chen| Melton|Hill|Puckett|Song|Hamilton|Bender} your {funny|witty|strange|fantastic} {dude|guy|man|bloke|{buster|nested area here}}


:sign0104:
 
Last edited by a moderator:
G

GCOINC

Guest
Looks good, however in most instances where we use spintax an entire list of all possible spins in not always required, normally an action is performed in a loop which pulls a new version (spintax) of the text in each pass.

Another method which can be implemented is a regular simple sentence or paragraph is input.

sentence = "John walks his dog"

This simple sentence is processed through a 'synonyms' DB or similar and 'spits out' processed spintax.

result = "{John|Jon|Johnathan} {walks|runs|skips|jogs} his {dog|k9|mutt|puppy}"

The 'synonyms' can be filtered on a scale from 'accurate', 'average' or 'slightly inaccurate' to get more/less total spintax.

Great stuff anyways, having a 'spintax' command for strings or blocks would be top notch if possible for b4a. :cool:
 
Upvote 0
Top