« Return to Thread: Program E bug

Re: Program E bug

by drwallace :: Rate this Message:

Reply to Author | View in Thread

Thanks Anne and Jeroen.  I published the proposed solution on my blog
at alicebot.org.

On Wed, May 28, 2008 at 5:45 AM,  <botmaster@...> wrote:

> Hi Rich,
>
> I tested it and seems to return right values for <star/>.
> It works now like in Pandorabots:
> Client: test xxx me
> Bot: TEST ME
> Client: xxx test me xxx
> Bot: TEST ME
>
> With the categories you mentioned for testing.
>
> Jeroen
> ----- Original Message -----
> From: "Dr. Rich Wallace" <drwallace@...>
> To: "Alicebot and AIML General Discussion"
> <alicebot-general@...>
> Sent: Thursday, May 22, 2008 11:46 PM
> Subject: Re: [alicebot-general] Program E bug
>
>
>>I am working with a developer who knows PHP well but not too much
>> AIML.  I know AIML but not much PHP.
>> He found something in the code that apparently fixes the bug, at least
>> in the tests we have done.
>> I don't know if anyone is officially maintaining Program E at the
>> moment, but anyone working with the code may be able to check this
>> solution.
>>
>> By the way, we are using version 0.8 of Program E.
>>
>> Here is what he said:
>>
>> Dr. Wallace, this is piece of code which was changed by me. The only
>> line I added is highlighted below.
>>
>> (the highlighted line is "     $inputstarvals=array();")
>>
>> This code is executed when no match is found by the "graphwalker".
>>
>>
>>
>> While graphwalker seeks for matches it would add any words matched by
>> "*" asterisk to $inputstarvals (which is a keyword holder) for further
>> references but when it comes to the end and has no matches it should
>> clear $inputstarvals reference and return back to the root of the
>> tree.
>>
>>
>>
>>          // Else no match found...
>>
>>          if
>> ((($whichresult[0]==-1)&&($whichresult[1]==-1)&&($whichresult[2]==-1))||($continuenode==1))
>> {
>>
>>                   //If we were most recently on a wildcard (*,_) then
>> we are still matching it.
>>
>>                   if
>> (($onwild==1)&&($word!="")&&($word!="<that>")&&($word!="<topic>")){
>>
>>                             debugger("On wild and in *. keep going
>> with graphwalker.",2);
>>
>>
>>
>>
>> addtostar($parton,$word,$inputstarvals,$thatstarvals,$topicstarvals,2);
>>
>>
>>
>>                             return
>> graphwalker($remains,$parent,1,1,$parton,$inputstarvals,$thatstarvals,$topicstarvals,$patternmatched);
>>
>>                   }
>>
>>                   else {
>>
>>                             //We didn't find anything. We need to come
>> back out
>>
>>                             $inputstarvals=array();
>>
>>                             debugger("Result is blank from query in
>> *. Returning blank",2);
>>
>>                             return "";
>>
>>                   }
>>
>>
>>
>>          }
>>
>> On Sat, May 17, 2008 at 5:17 PM, A. Kootstra <anne@...> wrote:
>>> Rich, thanks for reporting this bug. When I looked into the archives I
>>> couldn't find a similar mentioning. Although I don't have a solution -
>>> yet.
>>> It's been confirmed on both PHP 4 and 5.
>>>
>>> When I looked into the code it appears to be working normally, but I do
>>> have
>>> a suspicion that the code for the processing of trees including an
>>> underscore might not work as intended since the call for storing a
>>> variable
>>> requires a parameter for addition instead of new creation. How and why I
>>> still need to figure out.
>>>
>>> To be continued.
>>>
>>> Anne.
>>>
>>> -----Oorspronkelijk bericht-----
>>> Van: alicebot-general-bounces@...
>>> [mailto:alicebot-general-bounces@...] Namens Dr. Rich
>>> Wallace
>>> Verzonden: vrijdag 16 mei 2008 19:52
>>> Aan: Alicebot and AIML General Discussion
>>> Onderwerp: [alicebot-general] Program E bug
>>>
>>> I found a bug in Program E and I'm wondering if anyone else has
>>> discovered a workaround.
>>>
>>> Suppose you create a simple default category:
>>>
>>>
>>> <category>
>>> <pattern>*</pattern>
>>> <template>Keywords: <star/></template>
>>> </category>
>>>
>>> Assuming  there is no other AIML, this category will just echo
>>> whatever you type:
>>>
>>> Client: Hello there
>>> Bot: Keywords: Hello there
>>> Client: testing one  two three
>>> Bot: Keywords: testing one two three
>>>
>>> Now add a second AIML category,
>>>
>>>
>>> <category>
>>> <pattern>_ TEST ME *</pattern>
>>> <template><srai>TEST ME</srai></template>
>>> </category>
>>>
>>> We get the expected result:
>>>
>>> Client: xxx test me xxx
>>> Bot: Keywords: TEST ME
>>>
>>> Ok, finally, add one more category:
>>>
>>>
>>> <category>
>>> <pattern>TEST * ME</pattern>
>>> <template><srai>TEST ME</srai></template>
>>> </category>
>>>
>>> Now it is messed up:
>>>
>>> Client: test xxx me
>>> Bot: ME
>>>
>>> What happened to the "TEST"?
>>> and even the one that worked before is broken:
>>>
>>> Client: xxx test me xxx
>>> Bot: ME
>>>
>>> If we copy the same AIML test file over to Pandorabots:
>>>
>>> Client: test xxx me
>>> Bot: TEST ME
>>> Client: xxx test me xxx
>>> Bot: TEST ME
>>>
>>> Does anyone with Program E experience have a workaround for this problem?
>>> _______________________________________________
>>> This is the alicebot-general mailing list
>>> Reply to alicebot-general@...
>>> Unsubscribe and change preferences at
>>> http://list.alicebot.org/mailman/listinfo/alicebot-general
>>> Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
>>> Learn to read at http://www.literacy.org/
>>>
>>> _______________________________________________
>>> This is the alicebot-general mailing list
>>> Reply to alicebot-general@...
>>> Unsubscribe and change preferences at
>>> http://list.alicebot.org/mailman/listinfo/alicebot-general
>>> Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
>>> Learn to read at http://www.literacy.org/
>>>
>> _______________________________________________
>> This is the alicebot-general mailing list
>> Reply to alicebot-general@...
>> Unsubscribe and change preferences at
>> http://list.alicebot.org/mailman/listinfo/alicebot-general
>> Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
>> Learn to read at http://www.literacy.org/
>>
>>
>
> _______________________________________________
> This is the alicebot-general mailing list
> Reply to alicebot-general@...
> Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general
> Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
> Learn to read at http://www.literacy.org/
>
_______________________________________________
This is the alicebot-general mailing list
Reply to alicebot-general@...
Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general
Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
Learn to read at http://www.literacy.org/

 « Return to Thread: Program E bug