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..

Clarification on the * operator
 
 

My AIML:

<category>
        <
pattern>How are you</pattern>
        <
template>I am good what about you</template>
    </
category>

    <
category>
        <
pattern>* good *</pattern>
        <
that>I am good what about you</that>
        <
template>Nice to hear :)</template>
    </
category>

    <
category>
        <
pattern>* bad *</pattern>
        <
that>I am good what about you</that>
        <
template>Dont worrythings will get better :)</template>
    </
category>

    <
category>
        <
pattern>how are you *</pattern>
        <
template> <srai>how are you</srai> </template>
    </
category

My CSV:

0How are you, *, *, I am good what about youhaalchal.aiml
0
, * good *, I am good what about you, *, Nice to hear :), haalchal.aiml
0
, * bad *, I am good what about you, *, Dont worry#Comma things will get better :), haalchal.aiml
0how are you *, *, *, <srai>how are you</srai>, haalchal.aiml 

When I ask the bot “how are you” it does answer it correctly “I am good what about you”
now when I reply “good”, it doesn’t recognizes that. From my understanding the * operator should also match zero characters, so “* good *” should be able to recognize “good” also, but it doesn’t.

But it does work when “good” is within a sentence. Same with “* bad *”

 

 
  [ # 1 ]

Nope! In AIML 1.0 and 2.0 the * wildcard matches one or more words (as does the _ wildcard). In AIML 2.0, there are other wildcards that match zero or more words. those are ^ and #, but these are not available in AIML interpreters that do not support the newer specification.

 

 
  [ # 2 ]

Thank you for the quick response.

 

 
  login or register to react