AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Using wildcards to answer a previous pattern with a wildcard
 
 

Hello all. I am new to AIML so forgive me for what might be a basic or oft-repeated question..

I’m wondering if someone can tell me how I can use the * wildcard to help answer a second question. I want to ensure that when

This is what I have:

* JOKE *
Would you like to hear a joke?
* YES *
<srai>tell me a joke</srai>

The problem is that when someone does write xxx joke and the response “would you like to hear a joke?” comes up, when they answer * yes * it does not tell the joke.

Can anyone help?

Thanks!

 

 
  [ # 1 ]

That’s because you’re expecting a * wildcard to match zero or more words, and this is just not the case. a “*” wildcard requires at least one word to be present in order to generate a match. Depending on the platform you’re using, there are other wildcards that can match zero or more words. These are “^” and “#”, but are only supported in AIML 2.0 so if you’re using a chatbot engine that doesn’t support AIML 2.0 you will need to rethink your code. You have to rethink it anyway, but if AIML 2.0 is supported, all you need to do is change the second “*” for a “^” and you’re golden. smile

 

 
  login or register to react