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

Short discussions don't work with line breaking

Open jps81 opened this issue 9 years ago • 1 comments

Using a slightly modified example from the documentation (with an added newline):

+ knock knock
- Who's \n
^ there?

+ *
% who * there
- <star> who?

+ *
% * who
- LOL! <star>! That's funny!

If I now follow the script, the final statement (LOL ...) is never reached. I suspect it is probably due to how the regex matching is being done here https://github.com/aichaos/rivescript-python/blob/master/rivescript/brain.py#L503. Adding the re.DOTALL flag would most likely fix this issue, but not sure if that is the correct answer here (I'm relatively new to rivescript). Any thoughts?

jps81 avatar Sep 16 '16 05:09 jps81

Assuming there is no substitution to convert from who's to who is, this script doesn't work on my computer. When I keep the script into the explicit form who is,

+ knock knock
- Who is \n
^ there?

+ *
% who * there
- <star> who?

+ *
% * who
- LOL! <star>! That's funny!

The flow of this discussion works again.

Type /quit when you're done to exit this example.

You> knock knock 
Bot> Who is 
there?
You> orange  
Bot> orange who?
You> banana
Bot> LOL! banana! That's funny!
You> 

@kirsle As I can't reproduce the bug, can you please confirm if there is still a bug here?

htdinh avatar Aug 09 '17 15:08 htdinh