使用AB.jar Google参考(alice)漫游器时:
使用此简单的简短脚本时:
<category><pattern>TOPIC 1</pattern>
<template>Topic 2 with current topic '<get name="topic"/>'.<think><set name="topic">topic2</set></think></template>
</category>
<topic name="TOPIC2">
<category><pattern>YES</pattern>
<template>Going to topic3-yes <think><set name="topic">topic3-yes</set></think></template>
</category></topic>
<topic name="TOPIC2">
<category><pattern>*</pattern>
<template>Going to topic3-rest on '<star/>' <think><set name="topic">topic3-rest</set></think></template>
</category></topic>
...回答“不是”将不会导航到主题3的“ *”模式。这是为什么?
这是对话。我用“ //这里”标记了意外的答案
Human : topic 1
Robot : Topic 2 with current topic 'unknown'.
Human : any
Robot : any is a name. // here -- expected to go to topic-3-rest
答案 0 :(得分:0)
在主题内放置“ _”模式(而不是“ *”模式)可以回答问题。
感谢Ubercoder:
该元素的优先级高于相同模式级别的其他模式。我不知道您使用的是AIML v1还是v2,但从广义上讲,共有3个级别的模式[但请参见下面的说明]
Most important level = patterns including underscore wildcards (_)
Middle level = atomic patterns without any wildcards
Lowest level = patterns including star wildcards (*)