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

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