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

counting the match times in the input
 
 

u:  ( << _~color >> )  The colors are :-


Sir
My question is how can i print all the color names that matches in the input from the color concept

We can use _0 _1 ... but how will in know the limit. Is there any concept of looping….

Thanks in Advance

Himanshu Raj

 

 
  [ # 1 ]

u: ( _~color) $_colors = ^join($_colors “, ” _0) ^retry(RULE)
u: (~color) The colors are $_colors.

 

 
  [ # 2 ]

Sir

Actually i want a rule for

Raj >> I am using gray black green and red colors

Harry >> So, you are using :- gray black green red

Thanks

 

 
  [ # 3 ]

So?  The rule I gave: u: ( _~color) $_colors = ^join($_colors “, ” _0) ^retry(RULE)  captures the colors from Raj input sentence. How you output it using a next rule is up to you

 

 
  [ # 4 ]

u: ( _~color) $_colors = ^join($_colors “, ” _0) ^retry(RULE)
u: (~color) The colors are $_colors.


interesting example
so the retry(rule) act on the same initial sentence, moving forward the pointer to next word of sentence, e.g.:

sentence:

green, yellow and my preferred red !

initial run:

_0 == green

first retry:

_0 == yellow

another retry:

_0 == red

another retry:

fail


that’s correct?

 

 

 

 
  [ # 5 ]
Giorgio Robino - Mar 30, 2017:

u: ( _~color) $_colors = ^join($_colors “, ” _0) ^retry(RULE)
u: (~color) The colors are $_colors.


interesting example!

so the retry(rule) act on the same initial sentence, moving forward the pointer to next word of sentence, e.g.:

sentence:

green and yellow and my preferred red !

initial run:

_0 == green

first retry:

_0 == yellow

another retry:

_0 == red

another retry:

fail


that’s correct?

 

 

 
  login or register to react