Using <that> with * in AIML

651 Views Asked by At

I'm trying to make my bot ask a question and reply depending on the answer. The question is something random, ending with 'how are you?'.

<aiml version = "1.0.1" encoding = "UTF-8">
   <category>
      <pattern>HI</pattern>
      <template>
          <random>
              <li>Hi! How are you?</li>
              <li>Hello there. How are you?</li>
              <li>Greeings. And how are you?</li>
          </random>
      </template>
   </category>

    <category>
        <pattern>GOOD</pattern>
        <that>* how are you?</that>
        <template>Happy to hear that.</template>
    </category>


    <category>
        <pattern>*</pattern>
        <template>Can you rephrase that?</template>
    </category>

</aiml>

If I reply 'Good', the bot will not understand and reply with 'Can you rephrase that?'.

1

There are 1 best solutions below

0
Ubercoder On

Try removing the question mark from the text inside your that tag. In AIML version 1 all patterns and 'that' tags should only use stars (*) underscores (_) or text in upper case. The upper case is more of a convention than an actual requirement.