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

Dr. Richard S. Wallace alicebot-archcomm@list.alicebot.org
Sat, 03 Nov 2001 08:55:09 -0800


Noel Bush wrote:

> 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>
>

In this example you use <template/> inside the <get>...</get>, which
presumably returns
the evaluated template, so that the same random list item reappears.

It might be more appropriate to invent a <response/> tag which stores the
result of the