rivescript-python icon indicating copy to clipboard operation
rivescript-python copied to clipboard

Getting star original formatting in object macros

Open staticdev opened this issue 8 years ago • 2 comments

> 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 avatar Oct 19 '17 23:10 staticdev

@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).

htdinh avatar Nov 20 '17 16:11 htdinh

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}

htdinh avatar Nov 20 '17 16:11 htdinh