Advanded Spintax

Chonchonts

Newbie
Joined
Jul 2, 2012
Messages
17
Reaction score
4
Hello,

I implement a simple Spintax interpreter for my bot, like with nested braces.

{hello|hi}, my name is {olivier | {david | nobody} }.

Do you have listen about advanced options for Spintax with additional features ?

I am looking for implements new things if you have ideas. I think about:

- implement probabilities like: { david#60 | nobody#40 }, have 60% chance of choose david and 40% chosse nobody.
- functions to mutualize and parametrize large portions of spintax.
- variables ?
- if/else conditions ? (if a { david | nobody } spintax give david, print goliath).
- ....
 
Hi,

Some nice ideas (I think) I make to improve spintax:

  • Mistakes : { picture!0,10 } => you have 10% of chance to introduce mispelling, to make more realistic the text. You can have: pictute (key missing, based on select keys neighbors), pivture, piccture (doble press), pictuer (swap letters). I want to implement that annotation to a whole spintax block like : { picture | movie}!0,10 (for make mistakes on picture and movie).
  • Variables : Seems to be very useful. For example: var urls = { moneysite1 | moneysite2 }; When you use 'urls' word in spintax, you will have the result of the spintax block : "Go here : { urls }". Very useful if you want to use the result of one spintax block in a whole page.
  • If else : I implement if/else condition after variables with ternary syntax in spintax block, like { urls == "moneysite1" ? moneysite 1 : other moneysite }.
  • to be continued...
 
Back
Top