-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
% with redirections. #135
Comments
Maybe you can re-arrange your triggers to avoid the need for this:
I typed a longer reply to this below: It looks like this was intended behavior. In # See if there were any %Previous's in this topic, or any topic related
# to it. This should only be done the first time -- not during a
# recursive redirection. This is because in a redirection, "lastreply"
# is still gonna be the same as it was the first time, causing an
# infinite loop!
if step == 0: I tried disabling that check and see if the rivescript-python unit tests failed, but none of the tests actually exercise the bug described in that comment. I traced the git history back and this check was there since the beginning of rivescript-python; so I went and checked the original Perl version's history, and it goes back as far as when I switched from Subversion to Git so don't have much more context on why I programmed it this way. However, here is an example RiveScript use case that would trigger the bug being protected from:
If a trigger with a %Previous redirected to another trigger that happened to match the same conditions as the original %Previous, an infinite loop occurs; RiveScript is programmed to break from infinite loops after 50 levels of recursion (by the With the %Previous check in place as it currently is, this chain of triggers works as expected:
But admittedly for your use case, this behavior isn't adequate. I'd be willing to accept a pull request if you find a solution to this problem. Simply removing the |
Yes, from the example you've made it worked for me even though that means making a few rules, that's not something I had in mind. But as long as it works, that's fine. |
Example:
I tried that way and it doesn't capture the %.
That way, doing redirections you lose the %. Is there any way to avoid losing the previous one? It's something I did sometimes when I used the AIML version
The text was updated successfully, but these errors were encountered: