2016-07-06 1 views
0
를 통해 AIML의 패턴을로드 할 수 없습니다

내가 주사위를 통해 AIML을 설치하고 쓴 한 파일 startup.py, STD-STARTUP.XML, basic.aiml핵심을에 bot_brain.brn 폴더. 이 STD-STARTUP.XML의 내용입니다파이썬

Loading std-startup.xml... done (0.06 seconds) 
WARNING: No match found for input: load aiml b 

Kernel bootstrap completed in 0.10 seconds 
Saving brain to core/bot_brain.brn... done (0.00 seconds) 

:

<aiml version="1.0.1" encoding="UTF-8"> 
    <!-- std-startup.xml --> 

    <category> 
     <pattern>load aiml b</pattern> 
     <template> 
      <learn>basic.aiml</learn> 
     </template> 
    </category> 

</aiml> 

이 파이썬 스크립트입니다 : 내가 startup.py를 실행하려고하면,이 경고를

import aiml 
import os 

kernel = aiml.Kernel() 

if os.path.isfile("core/bot_brain.brn"): 
    kernel.bootstrap(brainFile = "core/bot_brain.brn") 
else: 
    kernel.bootstrap(learnFiles = "std-startup.xml", commands = "load aiml b") 
    kernel.saveBrain("core/bot_brain.brn") 

while True: 
    msg = raw_input(">") 
    if msg == "exit": 
     exit(0) 
    elif msg == "save": 
     kernel.saveBrain("core/bot_brain.brn") 
    else: 
     bot_response = kernel.respond(msg) 
     print("bot: " + bot_response) 

모든 입력에 대해 오류 No match found for input가 표시됩니다. 내가 뭘 잘못하고있어? 모든 것은 bot_brain.brn을 제외하고는 같은 디렉토리에 있습니다.

답변

0

문제가 해결되었습니다. 대문자로 입력해야했습니다.

<category> 
    <pattern>LOAD AIML B</pattern> 
    <template> 
     <learn>basic.aiml</learn> 
    </template> 
</category>