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.
This code is executed when no match is found by the “graphwalker”.
As graphwalker searches for matches it adds words matched by the “*” wildcard to $inputstarvals.
But when it reaches it the end of the input and finds no matches it should clear $inputstarvals reference and return back to the root of the tree.
// Else no match found...
//If we were most recently on a wildcard (*,_) then we are still matching it.
debugger("On wild and in *. keep going with graphwalker.",2);
//We didn't find anything. We need to come back out
debugger("Result is blank from query in *. Returning blank",2);
Attached is the latest (Program E 0.9) version of this script. We use version is 0.8. This code should work the same way in the latest version. Changes which were introduced between 0.8 and 0.9 are not related to this piece of code.