[alicebot-archcomm] [proposal] <get pattern=

Noel Bush alicebot-archcomm@list.alicebot.org
Sun, 4 Nov 2001 14:13:32 +0300


This is a simple proposal for an extension to AIML.

1. Allow the use of any combination of {pattern, that, topic} attributes
on the get element.

2. Interpret any combination of {pattern, that, topic} attributes as a
reference to a category.  If any of these three attributes appears but
the others do not, the others are interpreted as having value "*".

3. If the category so referenced has been activated (in this user
context), allow use the use of any template-side elements, including
template itself, within this get.  The template-side elements used
should return their values at the time of activation.

4. A combination of name and any of these three attributes would be an
invalid get (e.g., <get name="foo" pattern="BAR"> would not be valid).

5. One shorthand can be used: <get pattern="*" that="*" topic="*"/> is
the same as <get pattern="*" that="*" topic="*"><template/></get>.

I think we should discuss this proposal without regard to implementation
difficulties, to start.  Clearly implementing it might have enormous
memory requirements.

It is clear that uses of this could often (most of the time) point to
categories that haven't been activated.  It may be that some
augmentation of condition or something else would help ease this
problem.  But I would ask that we consider such proposals separately.

Here are examples of how this proposal could be used:

<!--Example 1-->
<category>
  <pattern>I LIKE *</pattern>
  <template>
    I'll remember that.
  </template>
</category>

<category>
  <pattern>WHAT DO I LIKE</pattern>
  <template>
    You told me you like <get pattern="I LIKE *"><star/></get>.
  </template>
</category>

<!--Example 2-->
<category>
  <pattern>TELL ME SOME GOSSIP</pattern>
  <template>
    <random>
      <li>I heard that the rain in Spain falls mainly in the plain.</li>
      <li>Eliza lives.</li>
      <li>Elvis has left the building, but not the Internet.</li>
      <li>To live outside the law you must be honest.</li>
    </random>
  </template>
</category>

<category>
  <pattern>TELL ME THAT GOSSIP AGAIN</pattern>
  <template>
    Last time I said <get pattern="TELL ME SOME
GOSSIP"><template/></get>.
  </template>
</category>

<!--Example 3-->
<category>
  <pattern>I TOLD YOU MY NAME IS *</pattern>
  <template>
    You said, and I quote, <get pattern="MY NAME IS *"><input/></get>.
  </template>
</category>