D:(("1 father|mother|brother|sister 2";"tell me about your 0."); ("1 am|i'm 2";"why are you 2|have you always been 2?"); ("1 i 2";"why do you 2?"); ("1 you 2";"we're talking about you, not me.|please don't be so personal.")) E:("that's very interesting. do go on."; "tell me more"; "i'm not sure i understand you fully"; "can you elaborate on that?") N:"0123456789" A:{`$"|"vs first w where not(first each w:" "vs x)in N}each D[;0] C:"|"vs'D[;1] P:`$(("you";"your";"yourself";"i";"am";"i'm");("i";"my";"myself";"you";"are";"you're")) person:{(y,x,z)(x,y)?z}. P / 1<->2 person words:{(`$" "vs x except".?")except`} / words in string match:{x in\:/:A} / boolean mask ante:{(any each x)?1b} / antecedent find:{x[y]?1b} / where match split:{1_'(0,1+y)_`,x} / split y on x snum:{x first raze x ss/:N} / substitution numeral resp:{x[y],z} / responses cons:{ssr[x;y;" "sv string(),person each z]} / construct response pick:{x rand count x} / pick randomly from x blank:{" "~x} / is x a blank? e:{$[count[b]=i:ante b:match w:words x;pick E; blank n:snum c:pick C i;c; cons[c;n]resp[w;k;split[w]k:find[b]i]N?n]} i:{while[count r:read0 0;-1"? ",e r;]} (-1 e@)each("hi. i'm going to be your worst nightmare"; "i think you're full of it."; "my mother told me so."; "no. you tell me about yours."; "you're obviously retarded."; "damn your eyes!"; "understand a kick in the pants?"; "i always ignore idiots."; "i am afraid of dinosaurs"); \ D:(("1 father|mother|brother|sister 2";"tell me about your 0."); ("1 am|i'm 2";"why are you 2|have you always been 2?"); ("1 i 2";"why do you 2?"); ("1 you 2";"we're talking about you, not me.|please don't be so personal.")) E:("that's very interesting. do go on."; "tell me more"; "i'm not sure i understand you fully"; "can you elaborate on that?") N:"0123456789" A:{`$"|"vs first w where not(first each w:" "vs x)in N}each D[;0] C:"|"vs'D[;1] p:{(y,x,z)(x,y)?z}.`$(("you";"your";"yourself";"i";"am";"i'm");("i";"my";"myself";"you";"are";"you're")) e:{w:(`$" "vs x except".?")except`; / words except punctuation, blanks b:w in\:/:A; / boolean mask: words X antecedents if[count[b]=i:(any each b)?1b;:E rand count E]; / if no key match on an antecedent, exit a:1_'(0,1+k:b[i]?1b)_`,w; / split input on key c:c rand count c:C i; / pick a consequent if[" "~n:c first raze c ss/:N;:c]; / which part if any of input to replace ssr[c;n;" "sv string(),p each(w[k],a)N?n]} / construct reply i:{while[count r:read0 0;-1"? ",e r;]} (-1 e@)each("hi. i'm going to be your worst nightmare"; "i think you're full of it."; "my mother told me so."; "no. you tell me about yours."; "you're obviously retarded."; "damn your eyes!"; "understand a kick in the pants?"; "i always ignore idiots."; "i am afraid of dinosaurs"); \ k: D:(("1 father|mother|brother|sister 2";"tell me about your 0.") ("1 am|i'm 2";"why are you 2|have you always been 2?") ("1 i 2";"why do you 2?") ("1 you 2";"we're talking about you, not me.|please don't be so personal.")) E:("that's very interesting. do go on." "tell me more" "i'm not sure i understand you fully" "can you elaborate on that?") N:"0123456789" A:{`$"|"\:*w@&~(*:'w:" "\:x)in N}'D[;0] C:"|"\:'D[;1] p:{(y,x,z)(x,y)?z}.`$(("you";"your";"yourself";"i";"am";"i'm");("i";"my";"myself";"you";"are";"you're")) e:{$[(#b)=i:(|/'b:(w@:&~(w:(`$" "\:x@&~x in".?"))in`)in\:/:A)?1b;E@*1?#E " "~n:c@*,/(c:{x@*1?#x}C i)ss/:N;c .q.ssr[c;n;" "/:$(),p'(w[k],a:1_'(0,1+k:b[i]?1b)_`,w)N?n]]} (-1 e@)'("hi. i'm going to be your worst nightmare" "i think you're full of it." "my mother told me so." "no. you tell me about yours." "you're obviously retarded." "damn your eyes!" "understand a kick in the pants?" "i always ignore idiots." "i am afraid of dinosaurs");