Skip to content

Maximum recursion depth exceed for "learn.aiml" examples #2

Description

@mertyildiran

Hey @creatorrr , thanks for this great library!

I'm facing with a problem while trying to use these learn.aiml files with your library.
Mitsuku: http://www.square-bear.co.uk/aiml/learn.zip
ALICE: http://alicebot.wikidot.com/learn-aiml (WRONG/OUTDATED)

It's trapping in to an infinite loop, how can I solve that? This is the error.log from the beginning to KeyboardInterrupt.

stderr:

WARNING: maximum recursion depth exceeded (input='xlearnfact')WARNING: maximum recursion depth exceeded (input='XEDUCATE WHAT IS .........
........XSPLIT a language XSPLIT')WARNING: maximum recursion depth exceeded (input='xlearnfact')Traceback (most recent call last):
  File "main2.py", line 5, in <module>
    print kernel.respond("Learn the sun is hot")
  File "/usr/local/lib/python2.7/dist-packages/aiml/Kernel.py", line 329, in respond
    response = self._respond(s, sessionID)
  File "/usr/local/lib/python2.7/dist-packages/aiml/Kernel.py", line 394, in _respond
    response += self._processElement(elem, sessionID).strip()
  File "/usr/local/lib/python2.7/dist-packages/aiml/Kernel.py", line 425, in _processElement
    return handlerFunc(elem, sessionID)
  File "/usr/local/lib/python2.7/dist-packages/aiml/Kernel.py", line 928, in _processTemplate
    response += self._processElement(e, sessionID)
  File "/usr/local/lib/python2.7/dist-packages/aiml/Kernel.py", line 425, in _processElement
    return handlerFunc(elem, sessionID)
.
.
.
.
    return handlerFunc(elem, sessionID)
  File "/usr/local/lib/python2.7/dist-packages/aiml/Kernel.py", line 871, in _processStar
    response = self._brain.star("star", input, that, topic, index)
  File "/usr/local/lib/python2.7/dist-packages/aiml/PatternMgr.py", line 181, in star
    patMatch, template = self._match(input.split(), thatInput.split(), topicInput.split(), self._root)
  File "/usr/local/lib/python2.7/dist-packages/aiml/PatternMgr.py", line 325, in _match
    pattern, template = self._match(suf, thatWords, topicWords, root[self._STAR])
  File "/usr/local/lib/python2.7/dist-packages/aiml/PatternMgr.py", line 307, in _match
    pattern, template = self._match(suffix, thatWords, topicWords, root[first])
  File "/usr/local/lib/python2.7/dist-packages/aiml/PatternMgr.py", line 325, in _match
    pattern, template = self._match(suf, thatWords, topicWords, root[self._STAR])
  File "/usr/local/lib/python2.7/dist-packages/aiml/PatternMgr.py", line 320, in _match
    if root.has_key(self._STAR):
KeyboardInterrupt

With these usage attempts both of them has same problem:

import aiml

kernel = aiml.Kernel()
kernel.learn("learn.aiml")
print kernel.respond("Learn the sun is hot")
import aiml

kernel = aiml.Kernel()
sessionId = 12345
kernel.getSessionData(sessionId)
kernel.learn("learn.aiml")
print kernel.respond("Learn the sun is hot")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions