[alicebot-archcomm] case
Noel Bush
alicebot-archcomm@list.alicebot.org
Wed, 14 Nov 2001 12:56:18 +0300
In my renovation work on Program D, I've come upon an issue concerning
case.
By converting all input paths to uppercase before performing a match,
one loses the ability to capture the values matched by wildcards in a
way that preserves the original case. Hence, the input "My name is
Noel" becomes "MY NAME IS NOEL", and if it matches "MY NAME IS *", and I
use <star/> in my template, the case is ambiguous.
Previously, this had been converted to lowercase, which I believe is an
incorrect behavior: incorrect because it is arbitrary -- no better than
leaving it uppercase.
Changing this has been relatively painless, although for some (probably
uninteresting) reasons I did have to change the Nodemapper interface
(!!) as well as Nodemaster to use Strings instead of Objects as keys. I
have also considerably reworked the normalization sequence (you can see
if you look in CVS).
Point is: I believe that the wording at [1] is incorrect. I believe
that the required behavior of the pattern matching process should be to
match case-insensitively, rather than to replace characters with their
uppercase equivalents.
In the presently checked-in code, I have implemented this behavior. One
consequence is that people no longer need to pepper their AIML with uses
of the <formal></formal> tag so much. Although it is still probably
"healthy" to do so when dealing with names, if one captures a wildcard
value a la <set name="name"><star/></set>, the case of the original will
be preserved.
I'd just like to know if my interpretation of expected behavior jibes
with others' viewpoints, and if not, what alternatives you'd propose.
Please think of this question from the point of view of a
forward-looking specification, not necessarily a question about Program
D or any given existing AIML. Although my change will not "break" any
existing AIML, since people were already dealing with the case loss, I
still don't want to focus on this specific code: I want to focus on how
the specification should best define the behavior.
Thanks.
[1]
http://www.alicebot.org/TR/2001/WD-aiml/#section-pattern-fitting-normali
zations