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

FAILRULE on nth
 
 

I have the following script on a rule but not sure why it is failing:
$$sent = “I am here and always will be”
@4 = burst($$sent)
say there
$$word = nth(@4subject 3)

I tried using nth(@4 3) but that does not compile saying I have to specifiy s v or o.

Here is the relevant trace:
$$sent =  “I am here and always will be” 
. . . . , . . . . @4 =
. . . . , . . . . System Call ^burst(“I am here and always will be”, ) = burst: I create ( I ^burst ^burst 0x110 ) Created 217041
burst: am create ( am ^burst ^burst 0x110 ) Created 217042
burst: here create ( here ^burst ^burst 0x110 ) Created 217043
burst: and create ( and ^burst ^burst 0x110 ) Created 217044
burst: always create ( always ^burst ^burst 0x110 ) Created 217045
burst: will create ( will ^burst ^burst 0x110 ) Created 217046
burst: be create ( be ^burst ^burst 0x110 ) Created 217047
. . . . , . . . . NOPROBLEM (^burst) =>
[7] 
=::  say =::  there
. . . . , . . . . $$word =
. . . . , . . . . System Call ^nth(I, 3, ) =
. . . . , . . . . FAILRULE (^nth) =>

 

 
  [ # 1 ]

^nth takes 2 arguments, evaluated.  So when you say @4subject, you get that value passed thru to ^nth. The documentation was incorrect on this. You pass a quoted argument ‘@0subject to make it work directly.
But an engine bug also intrudes. Will release new version in a day or two.

 

 
  login or register to react