英文:
AIML: List of choices is not finding matching pattern
问题
我正在尝试构建此处列出的示例文件。https://docs.bmc.com/docs/display/public/BVA9/Sample.aiml+file
我成功编写了文件(我认为是正确的),在这里:https://gist.github.com/pemby/679571f9eb9a413faa72811bbbe85621
运行文件后,我认为第一个模式匹配失败。
<category>
<pattern>CMP</pattern>
<template>
您想要更改哪个密码?<br/>
1) Lotus密码。<br/>
2) Sgate密码。<br/>
3) NT/PC密码。<br/>
输入您的选择-1/2/3。
</template>
</category>
然后在这里失败...
<category>
<pattern>1</pattern>
<that>* 输入您的选择-1/2/3。</that>
<template>
<think>
<set name="option1">1</set>
</think>
<srai>ACMP</srai>
</template>
</category>
英文:
I am attempting to build the example file that is listed here. https://docs.bmc.com/docs/display/public/BVA9/Sample.aiml+file
I was able to write out the file (I think correctly) here.
https://gist.github.com/pemby/679571f9eb9a413faa72811bbbe85621
Running the file I think it is failing the first pattern match.
<category>
<pattern>CMP</pattern>
<template>
Which password do you want to change?<br/>
1) Lotus password.<br/>
2) Sgate password. <br/>
3) NT/PC password.<br/>
Enter yoour choice-1/2/3.
</template>
</category>
Then fails here...
<category>
<pattern>1</pattern>
<that>* Enter your choice-1/2/3.</that>
<template>
<think>
<set name="option1">1</set>
</think>
<srai>ACMP</srai>
</template>
</category>
答案1
得分: 1
在你的第一个类别中,"yoour" 这个词有一个拼写错误。此外,你需要在第一个类别的末尾添加 "</category>"。在你的第二个类别中,你检查了错误的 "<that>" 值(你学习的文档是不正确的)。我已经发布了你的代码的正确可运行版本。
<category>
<pattern>CMP</pattern>
<template>
你想要更改哪个密码?<br/>
1) Lotus密码。<br/>
2) Sgate密码。<br/>
3) NT/PC密码。<br/>
输入你的选择-1/2/3。
</template>
</category>
<category>
<pattern>1</pattern>
<that>输入你的选择 *</that>
<template>
<think>
<set name="option1">1</set>
</think>
<srai>ACMP</srai>
</template>
</category>
英文:
You have a typo of "yoour" in your first category. Also you need to add </category> at the end of your first category. You are checking for the wrong value of <that> in your second category (the documentation you are learning from is incorrect). I've posted the correct and working version of your code.
<category>
<pattern>CMP</pattern>
<template>
Which password do you want to change?<br/>
1) Lotus password.<br/>
2) Sgate password. <br/>
3) NT/PC password.<br/>
Enter your choice-1/2/3.
</template>
</category>
<category>
<pattern>1</pattern>
<that>ENTER YOUR CHOICE *</that>
<template>
<think>
<set name="option1">1</set>
</think>
<srai>ACMP</srai>
</template>
</category>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论