AI Zone Admin Forum Add your forum

CX Company, chatbot market leader in the Netherlands since 2005, will speak on the Amsterdam Chatbots Meetup on Wednesday, Oct 18!

Topic tag not working, still taking template from outside pattern
 
 

Hello,

I have this code:

<category>
 <
pattern>*</pattern>
 <
that>LET S TALK ABOUT *</that>
 <
template>
 <
random>
  <
li>
  <
think><set name="topic">age</set></think>
            <
condition name="age">
                <
li value="">How old are you?</li>
                <
li>I know you are<get name="age"/> yoWe can talk about this</li>
        </
condition>
  </
li>
  
  
  <
li>
  <
think><set name="topic">occupation</set></think>
           <
condition name="occupation">
               <
li value="">Do you have a job?</li>
               <
li>I know you are a <get name="occupation"/>, let's talk about this</li>
           </condition>
  </li>
  
 </random>  
 </template>
 </category>
 
 <topic name="occupation">
  <category>
  <pattern>*</pattern>
  <template>YOU ARE INSIDE TOPIC OCCUPATION</template>
  </category>
 </topic>
 
 <topic name="age">
  <category>
  <pattern>*</pattern>
  <template>YOU ARE INSIDE TOPIC AGE</template>
  </category>
 </topic>

<category>
<pattern>*</pattern>
<template>Let'
s talk about something else.</template>
</
category

But whenever I answer to the bot, instead of telling me “YOU ARE INSIDE TOPIC OCCUPATION / YOU ARE INSIDE TOPIC AGE”, it still responds with “Let’s talk about something else.”

 

 
  [ # 1 ]

I’m going to answer my own question:

The values should all be in CAPS.

<think><set name=“topic”>AGE</set></think>


<topic name=“AGE”>

 

 
  [ # 2 ]

Hi, Alexandru, and welcome to chatbots.org. smile

Many AIML interpreters are case sensitive when it comes to values for various attributes, the name attribute for topic tags being among them. This means that when you set a topic, your AIML code must use the same case as what was set, but it shouldn’t matter if you use upper or lower case, so long as you’re consistent. Some AIML interpreters (e.g. Program O) don’t have this restriction, so the case of the attribute/set value won’t matter.

 

 
  [ # 3 ]

Hi Dave,

Using topic with lower didn’t work (such as <set name=“topic”>age</set>), but it worked with CAPS.

I’m using PYTHON-AIML.

 

 
  [ # 4 ]

Ah. that explains things. ALL of rhe AIML interpreters have their own special quirks. I guess you’ve found the quirk in yours. cheese

 

 
  login or register to react