[alicebot-archcomm] pluggable pattern processor

Ernest Lergon alicebot-archcomm@list.alicebot.org
Tue, 04 Mar 2003 00:56:17 +0100


Dr. Rich wrote:
>
> <pp name="AIML"> is the default
> <pp name="regular expressions"> [wow]+
> <pp name="neural networks"> cool!
> <pp name="fuzzy"> Whatever!
> <pp name="snobol"> I've died and gone to heaven.
> 
> The only really significant matter this committee would need to decide is
> the priority of pattern matching processors, so to preserve the property
> that the result should be exactly one unique AIML template.
> 
> In fact who needs a new tag, we could make it an attribute of the
> <pattern> tag.
> 
By introducing this, we would only transfer the problem - if it is
really a problem - one level up without coming to a solution.

Moreover this might lead to confusion - see below.

We should leave special processing - aka non-Graphmaster algorithms - up
to the <php>, <perl>, <javascript> etc. tags. Instead of using <pp
name="sql"> it might be better to embed a database connection as
proposed in
http://list.alicebot.org/pipermail/alicebot-general/2003-March/007719.html

Gary Dubuque wrote:
> 
> I want <srai> on the pattern side so I can call these pluggable patterns
> from within the normal pattern recognition processing!  Actually, isn't that
> what <pp> really is?  I'm all for it!  Let's do it and not the attribute on
> the <pattern> since we wouldn't know precedence without the embedding.
> 
> Only, can we use the output of the <pp> processing?  It there a <ppstar> or
> <ppinput> we should add to the template side for utilizing the subset of the
> input applied to the <pp> matching?
> 
What should be the difference between <ppstar> and <star>? How should a
<srai> work on pattern side?

The only tag allowed in <pattern> (and <that> and <topic> I think) is
<bot>. But this is just a placeholder - look at it as a constant
expression. This constant is replaced on startup of the bot by the
corresponding value of the property and than the pattern is never
changed during run. It is just a convenient way to develop a bot:
Instead of editing thousands of cats you just change one property and
reload the knowledge base.

No, no, we'd leave the fascinating simplicity of AIML behind tampering
with the pattern language that way.

I think, it's better to extend the pattern language very carefully and
solve problems like match order there.

Please see again
http://alice.sunlitsurf.com/pipermail/alicebot-patterns/2002-July/000253.html

The pattern itself is just like an expression in a big switch statement
matched against the normalized input - not more but also not less!

Those patterns can't be dynamic, otherwise I can imagine many
implementation, many more logical and much more explanation problems.

It's more the art of writing categories in order to simplify inputs by
removing irrelevant parts to boil down a sentence to its essence. There
- and only there - the <srai> is an integral part of AIML.

For instance: The question is not, which of the cats 'HEY *', 'HEY * *',
'HEY * DUDE' or 'HEY SURFER DUDE' is the "best" match. Change your mind
and write (shortcut code):

<pat>HEY *
<tem><srai>HELLO <star/></srai>

<pat>HI *
<tem><srai>HELLO <star/></srai>

<pat>WELCOME *
<tem><srai>HELLO <star/></srai>

<pat>HELLO *
<tem>Hello to you, too! <sr/>

<pat>* DUDE
<tem><srai>DUDE</srai>

<pat>DUDE
<tem>Why do you call me dude?

Moreover, in another scenario the sentence 'Hey surfer dude' might only
be part of a longer sentence, which is matched anywhere else, so that
'Hey..' is discarded as irrelevant by <srai> anyway.

Ernest

-- 
              ProgramV - Alice on Perl - available at
               http://www.virtualitas.net/perl/aiml/

      VIRTUALITAS - Manufacturer of fine OOPPS - since 1996
*********************************************************************
* VIRTUALITAS Inc.               *      http://www.virtualitas.net  *
*                                *                                  *
* European Consultant Office     *                                  *
* Internationales Handelszentrum *                                  *
* Friedrichstraße 95             *   contact:Ernest Lergon          *
* 10117 Berlin / Germany         *    mailto:Ernest@virtualitas.net *
*********************************************************************
      PGP-Fingerprint 6E6F DC17 A886 342D  D63F 7880 12F5 6BA9
        PGP-Key http://www.virtualitas.net/Ernest_Lergon.asc