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

Cannot seem to match an exact pattern with “What”
 
 

Hey everyone!

So I’m trying to match the pattern

topic: ~keywordless keep repeat nostay()

#! What you call
s: ( What you call hello 

But :verify gives me

kent: > :verify
Command
: :verify
VERIFYING 
~keywordless ......
Pattern failed to match 1 ~keywordless.0.0:  What you call => s:  ( What you call )
    
Adjusted Inputwhat be you call
    Canonical Input
what be you call 

The following works

topic: ~keywordless keep repeat nostay()

#! you call
s: ( you call hello 

so I’m assuming there is some special property with the word “What”?

Can someone help me get this exact pattern with “What” working? I’m using the default Harry bot as my control script (with minor naming changes). The keywordless.top is my only other script for this bot.

Thanks!

 

 
  [ # 1 ]

Figured out the answer! :prepare helped me

topic: ~keywordless keep repeat nostay()

#! What you call
?: ( What be you call hello 
 

 
  [ # 2 ]

As you noted :prepare is the answer in many questions.

But I would also note that generally you don’t use capital letters in patterns, so I would replace What with what. CS automatically will handle the case differences, and using lowercase w will ensure that if the user doesn’t use a capital then the pattern will still match.

 

 
  [ # 3 ]

Also,

The correct usage would be “What do you call…?”

So you can have optional words surrounded by {} and the following pattern:

u: ( what {be do} you call ) I do not know what to call it.

would work for the following inputs:
what you call
what be you call
what do you call

The prepare command shows you that the “what you” is being changed into “what be you” in the substitution phase.  The LIVEDATA folder holds the files used for substitutions.  I did not see any entry that would explain why Chatscript is adding the “be” word.  The verb “to be” is a special case and I believe there are many “hard coded” rules in Chatscript for handling this irregular verb.

I use :prepare all of the time when debugging to see what Chatscript is translating my input into.  Have fun.

 

 

 
  login or register to react