[alicebot-general] Fwd: Fwd: AIML conflict solving

Noel Bush noel at aitools.org
Fri Sep 22 09:40:32 PDT 2006


> From: Houssem BDIOUI <houssem.bdioui at gmail.com>
> Date: Sep 22, 2006 4:36 PM
> Subject: Re: [alicebot-general] Fwd: AIML conflict solving
> To: Alicebot and AIML General Discussion <alicebot-general at list.alicebot.org >
> 
> 
> Mehri,
> 
> Thanks for your quick answer. The point is that when running the above algorithm
> ProgramQ matches the "* But *" pattern just because 'But' word comes
> first in the nodemapper list
> (before 'IS'), probably because of alphabetic sorting. And probably
> that's the error: I should not do
> an alphabetic sort of the words. isn't it?

However you sort the words shouldn't matter.  What matters is whether 
you do this:

A1.  match "programq" to "*"
A2.  match "is" to "IS"

or this:

B1.  match "programq" to "*"
B2.  match "is" to the same "*" <--- why?
B3.  match "cool" to the same "*"
B4.  match "but" to "BUT"

The (B) scenario is wrong.  You should be matching "is" to "IS".  The 
spec effectively describes a non-greedy scenario, as Mehri pointed out, 
even though it doesn't say so.

And in your second example, the output "second" is also wrong, for the 
same reason.  You should match "went" to "WENT".

The point is that AIML pattern matching doesn't incorporate any looking 
ahead.  This avoids the need for any scoring of matches to say that one 
pattern "matches better" than another.  A match scoring approach can 
seem appealing at first, but in the long run it makes behavior a lot 
more difficult to predict.  The great thing about the AIML pattern 
matching algorithm is that it is very predictable.  Even if it doesn't 
seem as convenient at first, you can always find a way to work with it, 
and your AIML sets will scale better because you don't have to try to 
account for complex interactions of a bunch of rules.

Noel


More information about the alicebot-general mailing list