Pam: Right now, it's better for the programmer, not yet better to talk to.

WinAlice is very simple: You enter a sentence, and WinAlice compares it to 10.000 patterns. A pattern can have one wildcard ('*') so that a pattern can match multiple sentences. There's more to WinAlice, like a spellchecker and some other stuff, but the basis is very simple.
The new program allows for much more complex patterns, with unlimited wildcards and optional parts, plus 'selections':
'a *' matches 'a cat' or 'a dog' or any other sentence starting with 'a '.
'a {cat|dog}' matches only 'a cat' or 'a dog'.
'a (lazy )cat' matches 'a cat' or 'a lazy cat'.
Curly brackets and regular brackets can be nested and mixed unlimited. This way, you can make very powerful patterns that match lots of subtle variations of the same sentence. This is very useful for reducing natural language to info that can be handled by the computer.
Once a match is made, a response is constructed, using a 'template'. This template can again have optional parts: This time, text between brackets is used in the asnwer in 50% of the cases. This is useful for randomizing responses, so that the chatbot does not give the same response all the time.
The template can also make use of variables (including stacks), if-then-else commands, recursion and so on to write really complex programs.
Anyway, it was fun building the interpreter.
- Jacco.