PYTHON 2.7中的AIML解析错误?

时间:2017-07-10 08:00:23

标签: python aiml

我在我的python AIML解释器中运行了learn.aiml,但它抛出了该死的解析错误错误是'

 python demo.py
Loading std-startup.xml... done (0.01 seconds)
PARSE ERROR: Unexpected <category> tag (line 74, column 4)
PARSE ERROR: Unexpected </learn> tag (line 82, column 6)
PARSE ERROR: Unexpected <learn> tag (line 83, column 6)
PARSE ERROR: Unexpected <eval> tag (line 86, column 8)
PARSE ERROR: Unexpected </learn> tag (line 92, column 6)
PARSE ERROR: Unexpected </template> tag (line 94, column 2)
PARSE ERROR: Unexpected </category> tag (line 95, column 0)
Loading learn.aiml... done (0.00 seconds)
Enter your message >> ^CTraceback (most recent call last):
  File "demo.py", line 10, in <module>
    print kernel.respond(raw_input("Enter your message >> "))
KeyboardInterrupt

并且负责错误的行是

<category>
  <pattern>XEDUCATE * XSPLIT * XSPLIT *</pattern>
  <template>

      <learn>
    <category>
      <pattern>
        <eval><uppercase><star index="1"/><star index="3"/></uppercase></eval>
      </pattern>
      <template>
        <eval><star index="2"/></eval>
      </template>
    </category>
      </learn>
      <learn>
    <category>
      <pattern>
        <eval><uppercase><star index="1"/><star index="2"/></uppercase></eval>
      </pattern>
      <template>
        <eval><star index="3"/></eval>
      </template>
    </category>
      </learn>

  </template>
</category>

行号以69行号开头..

AIML文件来源http://alicebot.wikidot.com/learn-aiml

1 个答案:

答案 0 :(得分:1)

Pandorabots是自己的解释器。您需要在http://www.pandorabots.com上设置一个帐户才能使用它