2

I can't figure out a way around making the following work after adding '!' in the mids of it

<category>
      <pattern>test</pattern>
      <template>testing stuff.</template>
  </category>
  <category>
        <pattern>gg</pattern>
        <that> testing stuff </that>
        <template>works</template>
  </category> 

the above code works just fine, but when you change it to:

<category>
      <pattern>test</pattern>
      <template>testing! stuff.</template>
  </category>
  <category>
        <pattern>gg</pattern>
        <that> testing stuff </that>
        <template>works</template>
  </category> 

It just stops working.

How do I get the second piece of code to work then? What the bot says HAS to include this '!' in the middle of it

EDIT:

I found out a way around it by doing the following:

<category>
      <pattern>test</pattern>
      <template>testing! stuff.</template>
  </category>
  <category>
        <pattern>gg</pattern>
        <that> stuff </that>
        <template>works</template>
  </category> 

It works since in the properties file it's configured to see '!' as a line splitter, but seems a little unintended... Is there any proper way to deal with this issue?

MrGuy
  • 654
  • 1
  • 5
  • 18
  • 1
    Hi! Sorry to ask in the comment here but didn't find any other way. According to your question, you already got tag working. So, can you please answer my question here? http://stackoverflow.com/questions/38646903/pyaiml-does-not-respond-on-that-tag. Thanks. – moshfiqur Jul 28 '16 at 21:44

1 Answers1

0

This is the way the AIML <that> tag is supposed to work. If the bot's last response consists of multiple sentences the tag only matches the bot's last sentence. Full stops and exclamation marks are sentence terminators so the reason <that>STUFF</that> works is because your bot's last response was two sentences (testing! and stuff.). The punctuation is removed when checking for the match, so 'stuff' matches.

There is a good explanation of <that> at https://pandorabots.com/docs/aiml-reference/#that

Sol
  • 344
  • 4
  • 17
Ubercoder
  • 711
  • 8
  • 24