rivescript-python
rivescript-python copied to clipboard
Getting star original formatting in object macros
> object names python
return ' '.join(args) # python3
< object
+ what [is|are] [the] (name|names) of *
- <call>names <star2></call> // or some other syntax
Is there a syntactic sugar or an easy way of getting 'Jason, Billy and Lara' from 'What are the names of Jason, Billy and Lara?'
@staticdev As far as I know, RiveScript preprocesses the message (which remove the non-syntax-related characters such as , Code Line 52 out before getting a reply Code Line 68). At this time of reply it doesn't (can't) recover the original formatting of the stars (in the end a regex match).
Just in case someone wants to have a quick code. You need to set star2 (otherwise, star alone would return you the choice of name or names).
+ what [is|are] [the] (name|names) of *
- {formal}<star2>{/formal}