AIML - topic - unexpected answer does not match with STAR (*)

落花浮王杯 提交于 2020-01-06 05:34:06

问题


When using the AB.jar Google reference (alice) bot:

When having this simple short script:

<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>

... answering not 'yes' will not navigate to the topic-3 '*' pattern. Why is that?

This is the conversation. I marked the unexpected answer with '// here'

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

回答1:


Putting this '_' pattern (in stead of the '*' pattern) inside a topic answers the question.

Thanks to Ubercoder:

The element takes priority over other patterns at the same pattern level. I don't know if you're using AIML v1 or v2, but broadly speaking there are 3 levels of patterns [but see note below]

Most important level = patterns including underscore wildcards (_)
Middle level = atomic patterns without any wildcards
Lowest level = patterns including star wildcards (*)


来源:https://stackoverflow.com/questions/52973100/aiml-topic-unexpected-answer-does-not-match-with-star

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!