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

Javascript 1.1.4 bug when using optionals after or after alternatives, or expected behaviour?
 
 

Hi,

Loving RiveScript (using the Javascript 1.1.4 lib), however I’m a bit puzzled by RiveScript’s behaviour and was wondering if this is a bug or not in the JavaScript lib implementation.

Given the following code,

+ (aa|bb|cc[some optional] *
TRIGGER 

an input of “aaabcdefg” gives an output of “TRIGGER”.

whereas with the following code

+ (aa|bb|cc) *
TRIGGER 

an input of “aaabcdefg” does not match.

Is this a bug or is this expected behaviour.

There are similar issues with [*] preceding a (aa|bb|cc) block, causing abcdefgaa to match.

It’s causing things like ‘yo’ (as a greeting) to match ‘you’, amongst other things.

Would anyone have any thoughts on this?

Cheers,

Ivo

 

 

 
  [ # 1 ]

Fixed by Noah. Now that’s dedication!

 

 
  login or register to react
‹‹ variable javascript      Authentication ››