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

way to specify 0 or more items from a concept?
 
 

Is there a way to specify 0 or more items from a concept?

As an example… the last pattern fails.  I could add another {~posAdverbs} but it seems kludgey.

#! I’m tired
#! I’m very tired
#! I’m always so tired
#! I’m just always so tired
u: (I [am feel] ![~negAdverbs] {~posAdverbs} {~posAdverbs} ~tired)

 

 
  [ # 1 ]

In this example… why are you tightly constraining the match for padding with posadverbs. Wouldn’t this be ok.

u: (!~negAdverbs I [am feel] *~3 ~tired)

This allows a match with “I am often tired”

 

 
  [ # 2 ]

I see users using a lot of unnecessary adverbs.  I am trying to avoid something like both of these phrases matching…

#! I’m awesome, my cat is tired
#! I’m just always so fricking tired

 

 
  [ # 3 ]

Then you can do your {~posadverb} {~posadverb} {~posadverb}
thing, since there is no repeat count for this. However, if you expect to have this often in rules, you can condense this into

patternmacro: ^posadverbs()
{~posadverb} {~posadverb} {~posadverb} {~posadverb} {~posadverb}

u: (!~nedadverbs I [am feel] ^posadverbs() ~tired)

 

 
  [ # 4 ]

ok thanks for the tip bruce.

 

 
  login or register to react