AI Zone Admin Forum Add your forum

Chatbot Conference London On Oct 3th Erwin will be moderating on the Chatbots conference in London. Why don't you meet him there? As a Chatbots.org visitor, you'll get a discount as well: Why don't we meet there? get a discount

We do experience some trouble with our forms and some details page. We'll fix this ASAP. Sorry for the inconvenience!
Only one word in input
 
 

Hi all,

I’m trying to write a rule to answer only if user type one word (or “concept”).
I really mean the input should consist of one specific word (or “concept”).

Test with one word, the rule is:

u: ( < ping > )
   
pong 

The answer:

b: > ping
Bot
:  Pong
b
: > ping server
Bot
:  I don't know what to say.
b: > I want to ping
Bot:  I don'
t know what to say.
b: > I want to ping server
Bot
:  I don't know what to say. 

Good, it answers only if user input exactly this word.

Now I want to do the same, but with concept ~emothanks.

u: ( ~emothanks > )
   
You are welcome

Now it doesn’t work: it answers even if user input something after ~emothanks:

b: > thanks
Bot
:  You are welcome!
b: > sirthanks
Bot
:  I don't know what to say.
b: > thanks, mister
Bot:  You are welcome! 

The last output is unexpected, it should answer “I don’t know what to say.”...

I tried this variant, with the same result:

u: ( < ~emothanks > ) 

How to fix this?
Thanks!

 

 
  [ # 1 ]

Hi Maxim

thanks, mister

is in CS a double sentence, where “,” is sentence separator.


standard CS control script consider just first sentence in input

thanks

so that match your pattern.

 

 

 
  [ # 2 ]

Thank you Giorgio for replay.

The same behavior without “,”:

b: > thanks master
Bot
:  You are welcome

I don’t understand why it happens as I put “>” in rule…

 

 
  [ # 3 ]
Maxim Shaydulin - Apr 14, 2017:

Thank you Giorgio for replay.

The same behavior without “,”:

b: > thanks master
Bot
:  You are welcome

I don’t understand why it happens as I put “>” in rule…

Just type in

:prepare thanks master

and you will see that chatscript is still splitting this up into two sentences.

You could try to set a cs_token that hasn’t #DO_INTERJECTION_SPLITTING in it.
I have not tested it though…

 

 
  [ # 4 ]

by default, interjections at the start of a sentence are split off into a separate sentence. You can either remove DO_INTERJECTION_SPLITTING from your bot definition of $cs_token OR change your rule to be
u: (~emothanks > !%more)  which confirms the interjection is the last thing in the sentence AND there are no more sentences

 

 
  [ # 5 ]

Tobias, you are right about DO_INTERJECTION_SPLITTING.

Bruce, “!%more” works fine, thank you for a great support!

 

 
  login or register to react