learn.aiml

This allows users to teach your bot new facts rather than just correcting its replies using badanswer.aiml. The user should say LEARN then the fact.

It will also learn if both sides of the statement are wilcards. Eg:

Human: Gateau is a type of cake
Bot: OK, I will add that fact about gateau to my database.
Human: What is gateau
Bot: A type of cake.

<?xml version="1.0" encoding="ISO-8859-1"?>

    <!-- Free software (c) 2001-2003 ALICE A.I. Foundation.   -->
    <!-- This program is open source code released under -->
    <!-- the terms of the GNU General Public License     -->
    <!-- as published by the Free Software Foundation.   -->
    <!-- Complies with AIML 1.0 Tag Set Specification -->
    <!-- as adopted by the ALICE A.I. Foundation.  -->
    <!-- Learn.aiml written by Square Bear on 6th March 2009 -->
    <!-- This AIML allows users to teach your bot  -->
    <!-- http://www.square-bear.co.uk -->

<aiml>

<category>
  <pattern>LEARN * MEANS *</pattern>
  <template>
          Ok I will learn that<star index="1"/>is<star index="2"/>.
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>LEARN * IS *</pattern>
  <template>
          Ok I will learn that<star index="1"/>is<star index="2"/>.
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>LEARN * WAS *</pattern>
  <template>
          Ok I will learn that<star index="1"/>was<star index="2"/>.
    <srai>XEDUCATE WHAT WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>LEARN * HAS *</pattern>
  <template>
          Ok I will learn that<star index="1"/>has<star index="2"/>.
    <srai>XEDUCATE WHAT HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>LEARN * ARE *</pattern>
  <template>
          Ok I will learn that<star index="1"/>are<star index="2"/>.
    <srai>XEDUCATE WHAT ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>XEDUCATE * XSPLIT * XSPLIT *</pattern>
  <template>

      <learn>
    <category>
      <pattern>
        <eval><uppercase><star index="1"/><star index="3"/></uppercase></eval>
      </pattern>
      <template>
        <eval><star index="2"/></eval>
      </template>
    </category>
      </learn>
      <learn>
    <category>
      <pattern>
        <eval><uppercase><star index="1"/><star index="2"/></uppercase></eval>
      </pattern>
      <template>
        <eval><star index="3"/></eval>
      </template>
    </category>
      </learn>

  </template>
</category>

<category>
  <pattern>* MEANS *</pattern>
  <template>
          Ok I will add that fact about<person/>to my database.
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>* IS A *</pattern>
  <template>
          Ok I will add that fact about<person/>to my database.
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>* IS *</pattern>
  <template>
          Ok I will add that fact about<person/>to my database.
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>* WAS *</pattern>
  <template>
          Ok I will add that fact about<person/>to my database.
    <srai>XEDUCATE WHAT WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>* HAS *</pattern>
  <template>
          Ok I will add that fact about<person/>to my database.
    <srai>XEDUCATE WHAT HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

<category>
  <pattern>* ARE *</pattern>
  <template>
          Ok I will add that fact about<person/>to my database.
    <srai>XEDUCATE WHAT ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHERE ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
    <srai>XEDUCATE WHO ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/></srai>
  </template>
</category>

</aiml>
Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.