getting interesting. I just stopped short of implementing the learn tag yesterday evening (last element to handle in the parser, the pattern matcher still needs a little updating, and testing of course).
If the gossip element isn’t used, I’ll simply generate a warning and don’t do anything with it then. (easiest solution)
A couple of questions:
-1 why do you put an ‘uppercase’ round the newly learned pattern. Is this just for pretty printing? I thought that the pattern-matcher was case-insensitive?
-2 I’m a little confused about the 2-zero length wildcards. What exactly do you guys mean?
Here’s what I did to get the _ and * working: Originally, my system only knew ‘*’, which has the lowest weight, while a static (exact match) has the highest weight (and a thesaurus variable in the middle). This is still the case, but I ‘ve added an extra (optional) parameter to the variable definitions, so that you can assign a weight that should be used. So now, I translate every ‘_’ to ‘$v0%1.2’ or ‘$v1%1.2’ where ‘vx’ is the name of the variable and %x.x determines the weight that the variable should get, in the examples 1.2 (while a static has a weight of 1 and a default variable 0.1)
So the ’ _ THANK YOU’ pattern would translate to ‘$v0%1.2 THANK YOU’ . If you would change it to ‘$v0%0.9 THANK YOU’, then it doesn’t override the ‘Why thank you’ pattern.
The Pattern ‘* thank you’ becomes ‘$v0 thank you’
and finally the pattern ‘* * thank you’ becomes ‘$v0:1 $v1 thank you’ (:x determines the nr of words that the variable should capture).