AI Zone Admin Forum Add your forum

CHATBOT MEETUP CHATBOT MEETUP CHATBOT MEETUP CHATBOT CHATBOT MEETUP CHATBOT MEETUP CHATBOT MEETUP CHATBOT MEETUP

On June 28th, 2017 we're organizing our next Chatbot Meetup in Amsterdam, The Netherlands. Feel free to join!'

How to get multiple occurrence of an element
 
 

This might be an easy question that has already been answered, but I don’t know what to search in the forum.

For example, I’d like to get all the fruits user likes.

user: I like apple, banana, and pear.
user: I like apple and banana.

rule: I like _~fruit

_0 seems will be the last fruit entered.

I don’t know how many types of fruit the user will say, but would like to catch all of them.

Thanks for any help!

 

 
  [ # 1 ]

Just saw another new post: https://www.chatbots.org/ai_zone/viewthread/2976/

Seems I should use ^join and ^retry to catch all of them.

 

 
  [ # 2 ]

BTW,

user: I like apple, banana, and pear.

or

user: I like apple; banana - pear,  mango - berries.


In this case user utterance is a multi-sentence (with default CS settings)

Bruce suggested to set tokenization control:

$cs_token = #NO_SENTENCE_END | #NO_HYPHEN_END | #NO_COLON_END | #NO_SEMICOLON_END

although with NO_SENTENCE_END the others may already be overridden (i havent checked.)

 

 

 
  login or register to react