[alicebot-archcomm] <that> / <input> precedence
Ernest Lergon
alicebot-archcomm@list.alicebot.org
Sat, 01 Mar 2003 16:33:01 +0100
Gary Dubuque wrote:
>
> Can we agree that the last sentence is the one used to match
> against <that>? (I think so.)
>
Yes.
ProgramV, whose algorithms are based on ProgramD, implements <that> and
<input> as stack. I think, other interpreters are acting the same.
Pattern-side <that>:
It's always the last sentence of the bot's last output used (aka <that
index="1,1"/>, see below).
Template-side <that>:
Due to the stack nature of <that> the indices always have to be counted
from the back:
alice: OneOne. OneTwo. OneThree.
<that/> = <that index="1,1"/> = OneThree
<that index="1,2"/> = OneTwo
<that index="1,3"/> = OneOne
user: ...
alice: TwoOne. TwoTwo. TwoThree.
<that/> = <that index="1,1"/> = TwoThree
<that index="1,2"/> = TwoTwo
<that index="1,3"/> = TwoOne
<that index="2,1"/> = OneThree
<that index="2,2"/> = OneTwo
<that index="2,3"/> = OneOne
Search for TESTTHAT and TESTTHATARRAY in
aiml/standard/dev-testcases.aiml for examples.
The same holds for <input>:
user: OneOne. OneTwo. OneThree.
<input/> = <input index="1,1"/> = OneThree
<input index="1,2"/> = OneTwo
<input index="1,3"/> = OneOne
alice: ...
Search for TESTINPUT in aiml/standard/dev-testcases.aiml for examples.
I think, it's a natural way to handle that, but this behaviour should be
expressed clearly in the AIML specs.
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