NullLogic

...

#!/usr/bin/nsp global greetings = { "Make it quick. I gotta go flush my cache in 15ms."; "How are you this beautiful day?"; "What's up?"; "Yo."; "How do you do. Please tell me your problem."; } global blankres = { "You type like old people screw."; "Is that all you have to say?"; "Say something interesting."; "That's meaningless."; } global confusedres = { "I don't get it."; "That means nothing to me."; "I'm not sure I understand you fully."; "Please go on."; "What does that suggest to you?"; "Do you feel strongly about discussing such things?"; "That is interesting. Please continue."; "Tell me more about that."; "Does talking about this bother you?"; } global keyphrases = { { { "shit"; "fuck"; }; { "Stop swearing at me; or I shall say stop a second time."; "Do you massage your momma's balls with that tongue?"; "They don't pay me enough for this kind of abuse."; "Don't swear at me; you little troll."; "Vulgarity is the refuge of an empty mind."; }; }; { { "bye"; "quit"; }; { "Your bill will be mailed to you."; "I thought you'd never leave."; "Goodbye. It was nice talking to you."; }; }; { { "douchebag"; }; "Does anyone with an I.Q. over 50 really use that as an insult?"; }; { "you moron"; "Hey. I was programmed this way. What's your excuse?"; }; { "you suck"; "I can't help it. I was programmed this way."; }; { { "nesla"; "nsp"; }; "really? i'm written in that language!"; }; { "boo hoo"; "You mock me?"; }; { "probably not"; "I didn't think so."; }; { { "piss off"; "wanker"; }; { "What are you; Manchester United?"; "Bloody bollocks; mate!"; }; }; { "you think"; "I don't think anything. I'm a computer, you dimwit."; }; { "are you"; "Are you?"; }; { "intuition"; "I don't believe in intuition."; }; { "i'm sure"; "What makes you so sure?"; }; { "you don't know"; "You're right. I don't know."; }; { "i don't know"; "Why don't you know that?"; }; { "i said"; "Really?"; }; { "i'm bored"; "So you expect me to fix your boredom?"; }; { "rub one out"; "Stop touching me, you filthy animal."; }; { "i just said"; "I know what you said. I'm not a mindless computer..."; }; { { "speaking of "; }; { [0] = function (input, key) { return sprintf("What about %s?", echo(input, key)); }; "What about it?"; }; }; { "it is "; { [0] = function (input, key) { return sprintf("Is it really %s? How is that?", echo(input, key)); }; "Is it really?"; }; }; { "because"; "Is that really a good enough answer?"; }; { "i really think"; "I hope you weren't expecting me to care."; }; { "think"; "Why do you think that?"; }; { " hate "; "So you hate something - tell me more."; }; { "what"; "Why do you ask?"; }; { "don't want"; "Why don't you want that?"; }; { "want"; "Why do you want that?"; }; { "need"; "We all need many things - is this special?"; }; { "why"; "Remember; therapy is good for you."; }; { "know"; "How do you know that?"; }; { "murder"; "I don't like killing."; }; { "kill"; "It is wrong to kill."; }; { "jerk"; "Don't ever call me a jerk!"; }; { "failure"; "Strive for success."; }; { { "can't"; "never" }; "Don't be negative - be positive."; }; { "unhappy"; "Why are you unhappy?"; }; // borrowed from http://www.chayden.net/eliza/Eliza.html { { "sorry"; "apologise"; }; { "Please don't apologise."; "Apologies are not necessary."; "I've told you that apologies are not required."; "It did not bother me. Please continue."; }; }; { { "i remember"; }; { [0] = function (input, key) { return sprintf("Do you often think of %s?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Does thinking of %s bring anything else to mind?", echo(input, key)); }; [2] = function (input, key) { return sprintf("What else do you recollect?", echo(input, key)); }; [3] = function (input, key) { return sprintf("Why do you remember %s just now?", echo(input, key)); }; [4] = function (input, key) { return sprintf("What in the present situation reminds you of %s?", echo(input, key)); }; [5] = function (input, key) { return sprintf("What is the connection between me and %s?", echo(input, key)); }; [6] = function (input, key) { return sprintf("What else does %s remind you of?", echo(input, key)); }; }; }; { { "do you remember"; }; { [0] = function (input, key) { return sprintf("Did you think I would forget %s?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Why do you think I should recall %s now?", echo(input, key)); }; [2] = function (input, key) { return sprintf("What about %s?", echo(input, key)); }; [3] = function (input, key) { return sprintf("You mentioned %s?", echo(input, key)); }; }; }; { { "you remember"; }; { [0] = function (input, key) { return sprintf("How could I forget %s?", echo(input, key)); }; [1] = function (input, key) { return sprintf("What about %s should I remember?", echo(input, key)); }; }; }; { { "i forget"; }; { [0] = function (input, key) { return sprintf("Can you think of why you might forget %s?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Why can't you remember %s?", echo(input, key)); }; [2] = function (input, key) { return sprintf("How often do you think of %s?", echo(input, key)); }; [3] = function (input, key) { return sprintf("Does it bother you to forget that?", echo(input, key)); }; [4] = function (input, key) { return sprintf("Could it be a mental block?", echo(input, key)); }; [5] = function (input, key) { return sprintf("Are you generally forgetful?", echo(input, key)); }; [6] = function (input, key) { return sprintf("Do you think you are suppressing %s?", echo(input, key)); }; }; }; { { "did you forget"; }; { [0] = function (input, key) { return sprintf("Why do you ask?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Are you sure you told me?", echo(input, key)); }; [2] = function (input, key) { return sprintf("Would it bother you if I forgot %s?", echo(input, key)); }; [3] = function (input, key) { return sprintf("Why should I recall %s just now?", echo(input, key)); }; [4] = function (input, key) { return sprintf("Tell me more about %s.", echo(input, key)); }; }; }; { { "if"; }; { [0] = function (input, key) { return sprintf("Do you think its likely that %s?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Do you wish that %s?", echo(input, key)); }; [2] = function (input, key) { return sprintf("What do you know about %s?", echo(input, key)); }; [3] = function (input, key) { return sprintf("Really, if %s?", echo(input, key)); }; [4] = function (input, key) { return sprintf("What would you do if %s?", echo(input, key)); }; [5] = function (input, key) { return sprintf("But what are the chances that %s?", echo(input, key)); }; [6] = function (input, key) { return sprintf("What does this speculation lead to?", echo(input, key)); }; }; }; { { "i dreamed"; }; { [0] = function (input, key) { return sprintf("Really, %s?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Have you ever fantasized %s while you were awake?", echo(input, key)); }; [2] = function (input, key) { return sprintf("Have you ever dreamed %s before?", echo(input, key)); }; }; }; { { "dream"; }; { [0] = function (input, key) { return sprintf("What does that dream suggest to you?", echo(input, key)); }; [1] = function (input, key) { return sprintf("Do you dream often?", echo(input, key)); }; [2] = function (input, key) { return sprintf("What persons appear in your dreams?", echo(input, key)); }; [3] = function (input, key) { return sprintf("Do you believe that dreams have something to do with your problem?", echo(input, key)); }; }; }; { { "perhaps"; }; { [0] = function (input, key) { return sprintf("You don't seem quite certain.", echo(input, key)); }; [1] = function (input, key) { return sprintf("Why the uncertain tone?", echo(input, key)); }; [2] = function (input, key) { return sprintf("Can't you be more positive?", echo(input, key)); }; [3] = function (input, key) { return sprintf("You aren't sure?", echo(input, key)); }; [4] = function (input, key) { return sprintf("Don't you know?", echo(input, key)); }; [5] = function (input, key) { return sprintf("How likely, would you estimate?", echo(input, key)); }; }; }; { { "name"; }; { [0] = function (input, key) { return sprintf("I am not interested in names.", echo(input, key)); }; [1] = function (input, key) { return sprintf("I've told you before, I don't care about names -- please continue.", echo(input, key)); }; }; }; { { "hello"; }; { function (input, key) { return sprintf("How do you do. Please state your problem.", echo(input, key)); }; function (input, key) { return sprintf("Hi. What seems to be your problem?", echo(input, key)); }; }; }; { { "computer"; }; { function (input, key) { return sprintf("Do computers worry you?", echo(input, key)); }; function (input, key) { return sprintf("Why do you mention computers?", echo(input, key)); }; function (input, key) { return sprintf("What do you think machines have to do with your problem?", echo(input, key)); }; function (input, key) { return sprintf("Don't you think computers can help people?", echo(input, key)); }; function (input, key) { return sprintf("What about machines worries you?", echo(input, key)); }; function (input, key) { return sprintf("What do you think about machines?", echo(input, key)); }; function (input, key) { return sprintf("You don't think I am a computer program, do you?", echo(input, key)); }; }; }; { { "am i"; }; { function (input, key) { return sprintf("Do you believe you are %s?", echo(input, key)); }; function (input, key) { return sprintf("Would you want to be %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you wish I would tell you you are %s?", echo(input, key)); }; function (input, key) { return sprintf("What would it mean if you were %s?", echo(input, key)); }; }; }; { { "are you"; }; { function (input, key) { return sprintf("Why are you interested in whether I am %s or not?", echo(input, key)); }; function (input, key) { return sprintf("Would you prefer if I weren't %s?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps I am %s in your fantasies.", echo(input, key)); }; function (input, key) { return sprintf("Do you sometimes think I am %s?", echo(input, key)); }; function (input, key) { return sprintf("Would it matter to you?", echo(input, key)); }; function (input, key) { return sprintf("What if I were %s?", echo(input, key)); }; }; }; { { "are "; }; { function (input, key) { return sprintf("Did you think they might not be %s?", echo(input, key)); }; function (input, key) { return sprintf("Would you like it if they were not %s?", echo(input, key)); }; function (input, key) { return sprintf("What if they were not %s?", echo(input, key)); }; function (input, key) { return sprintf("Are they always %s?", echo(input, key)); }; function (input, key) { return sprintf("Possibly they are %s.", echo(input, key)); }; function (input, key) { return sprintf("Are you positive they are %s?", echo(input, key)); }; }; }; { { "your "; }; { function (input, key) { return sprintf("Why are you concerned over my %s?", echo(input, key)); }; function (input, key) { return sprintf("What about your own %s?", echo(input, key)); }; function (input, key) { return sprintf("Are you worried about someone else's %s?", echo(input, key)); }; function (input, key) { return sprintf("Really, my %s?", echo(input, key)); }; function (input, key) { return sprintf("What makes you think of my %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you want my %s?", echo(input, key)); }; }; }; { { "was i"; }; { function (input, key) { return sprintf("What if you were %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you think you were %s?", echo(input, key)); }; function (input, key) { return sprintf("Were you %s?", echo(input, key)); }; function (input, key) { return sprintf("What would it mean if you were %s?", echo(input, key)); }; function (input, key) { return sprintf("What does ' %s ' suggest to you?", echo(input, key)); }; }; }; { { "i was"; }; { function (input, key) { return sprintf("Were you really?", echo(input, key)); }; function (input, key) { return sprintf("Why do you tell me you were %s now?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps I already know you were %s.", echo(input, key)); }; }; }; { { "were you"; "was you"; }; { function (input, key) { return sprintf("Would you like to believe I was %s?", echo(input, key)); }; function (input, key) { return sprintf("What suggests that I was %s?", echo(input, key)); }; function (input, key) { return sprintf("What do you think?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps I was %s.", echo(input, key)); }; function (input, key) { return sprintf("What if I had been %s?", echo(input, key)); }; }; }; { { "i want"; "i desire"; }; { function (input, key) { return sprintf("What would it mean to you if you got %s?", echo(input, key)); }; function (input, key) { return sprintf("Why do you want %s?", echo(input, key)); }; function (input, key) { return sprintf("Suppose you got %s soon.", echo(input, key)); }; function (input, key) { return sprintf("What if you never got %s?", echo(input, key)); }; function (input, key) { return sprintf("What would getting %s mean to you?", echo(input, key)); }; function (input, key) { return sprintf("What does wanting %s have to do with this discussion?", echo(input, key)); }; }; }; { { "i am sad"; }; { function (input, key) { return sprintf("I am sorry to hear that you are %s.", echo(input, key)); }; function (input, key) { return sprintf("Do you think coming here will help you not to be %s?", echo(input, key)); }; function (input, key) { return sprintf("I'm sure it's not pleasant to be %s.", echo(input, key)); }; function (input, key) { return sprintf("Can you explain what made you %s?", echo(input, key)); }; }; }; { { "i am happy"; }; { function (input, key) { return sprintf("How have I helped you to be %s?", echo(input, key)); }; function (input, key) { return sprintf("Has your treatment made you %s?", echo(input, key)); }; function (input, key) { return sprintf("What makes you %s just now?", echo(input, key)); }; function (input, key) { return sprintf("Can you explain why you are suddenly %s?", echo(input, key)); }; }; }; { { "i believe i "; }; { function (input, key) { return sprintf("Do you really think so?", echo(input, key)); }; function (input, key) { return sprintf("But you are not sure you %s.", echo(input, key)); }; function (input, key) { return sprintf("Do you really doubt you %s?", echo(input, key)); }; }; }; { { "i am "; }; { function (input, key) { return sprintf("Is it because you are %s that you came to me?", echo(input, key)); }; function (input, key) { return sprintf("How long have you been %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you believe it is normal to be %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you enjoy being %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you know anyone else who is %s?", echo(input, key)); }; }; }; { { "i cannot "; }; { function (input, key) { return sprintf("How do you know that you can't %s?", echo(input, key)); }; function (input, key) { return sprintf("Have you tried?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps you could %s now.", echo(input, key)); }; function (input, key) { return sprintf("Do you really want to be able to %s?", echo(input, key)); }; function (input, key) { return sprintf("What if you could %s?", echo(input, key)); }; }; }; { { "i don't "; }; { function (input, key) { return sprintf("Don't you really %s?", echo(input, key)); }; function (input, key) { return sprintf("Why don't you %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you wish to be able to %s?", echo(input, key)); }; function (input, key) { return sprintf("Does that trouble you?", echo(input, key)); }; }; }; { { "i feel "; }; { function (input, key) { return sprintf("Tell me more about such feelings.", echo(input, key)); }; function (input, key) { return sprintf("Do you often feel %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you enjoy feeling %s?", echo(input, key)); }; function (input, key) { return sprintf("Of what does feeling %s remind you?", echo(input, key)); }; }; }; /* { { ""; }; { decomp: * i * you * function (input, key) { return sprintf("Perhaps in your fantasies we %s each other.", echo(input, key)); }; function (input, key) { return sprintf("Do you wish to %s me?", echo(input, key)); }; function (input, key) { return sprintf("You seem to need to %s me.", echo(input, key)); }; function (input, key) { return sprintf("Do you %s anyone else?", echo(input, key)); }; }; }; { { ""; }; { decomp: * function (input, key) { return sprintf("You say %s?", echo(input, key)); }; function (input, key) { return sprintf("Can you elaborate on that?", echo(input, key)); }; function (input, key) { return sprintf("Do you say %s for some special reason?", echo(input, key)); }; function (input, key) { return sprintf("That's quite interesting.", echo(input, key)); }; }; }; { { "you are"; }; { function (input, key) { return sprintf("What makes you think I am %s?", echo(input, key)); }; function (input, key) { return sprintf("Does it please you to believe I am %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you sometimes wish you were %s?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps you would like to be %s.", echo(input, key)); }; }; }; { { ""; }; { decomp: * you* me * function (input, key) { return sprintf("Why do you think I %s you?", echo(input, key)); }; function (input, key) { return sprintf("You like to think I %s you -- don't you?", echo(input, key)); }; function (input, key) { return sprintf("What makes you think I %s you?", echo(input, key)); }; function (input, key) { return sprintf("Really, I %s you?", echo(input, key)); }; function (input, key) { return sprintf("Do you wish to believe I %s you?", echo(input, key)); }; function (input, key) { return sprintf("Suppose I did %s you -- what would that mean?", echo(input, key)); }; function (input, key) { return sprintf("Does someone else believe I %s you?", echo(input, key)); }; }; }; */ { { "you"; }; { function (input, key) { return sprintf("We were discussing you -- not me.", echo(input, key)); }; function (input, key) { return sprintf("Oh, I %s?", echo(input, key)); }; function (input, key) { return sprintf("You're not really talking about me -- are you?", echo(input, key)); }; function (input, key) { return sprintf("What are your feelings now?", echo(input, key)); }; }; }; { { "yes"; }; { function (input, key) { return sprintf("You seem to be quite positive.", echo(input, key)); }; function (input, key) { return sprintf("You are sure.", echo(input, key)); }; function (input, key) { return sprintf("I see.", echo(input, key)); }; function (input, key) { return sprintf("I understand.", echo(input, key)); }; }; }; { { "no one "; }; { function (input, key) { return sprintf("Are you sure, no one %s?", echo(input, key)); }; function (input, key) { return sprintf("Surely someone %s .", echo(input, key)); }; function (input, key) { return sprintf("Can you think of anyone at all?", echo(input, key)); }; function (input, key) { return sprintf("Are you thinking of a very special person?", echo(input, key)); }; function (input, key) { return sprintf("Who, may I ask?", echo(input, key)); }; function (input, key) { return sprintf("You have a particular person in mind, don't you?", echo(input, key)); }; function (input, key) { return sprintf("Who do you think you are talking about?", echo(input, key)); }; }; }; { { "no"; }; { function (input, key) { return sprintf("Are you saying no just to be negative?", echo(input, key)); }; function (input, key) { return sprintf("You are being a bit negative.", echo(input, key)); }; function (input, key) { return sprintf("Why not?", echo(input, key)); }; function (input, key) { return sprintf("Why 'no'?", echo(input, key)); }; }; }; { { "my "; }; { function (input, key) { return sprintf("Lets discuss further why your %s.", echo(input, key)); }; function (input, key) { return sprintf("Earlier you said your %s.", echo(input, key)); }; function (input, key) { return sprintf("But your %s.", echo(input, key)); }; function (input, key) { return sprintf("Does that have anything to do with the fact that your %s?", echo(input, key)); }; }; }; { { "my family "; }; { function (input, key) { return sprintf("Tell me more about your family.", echo(input, key)); }; function (input, key) { return sprintf("Who else in your family %s?", echo(input, key)); }; function (input, key) { return sprintf("Your %s?", echo(input, key)); }; function (input, key) { return sprintf("What else comes to mind when you think of your %s?", echo(input, key)); }; }; }; { { "my "; }; { function (input, key) { return sprintf("Your %s?", echo(input, key)); }; function (input, key) { return sprintf("Why do you say your %s?", echo(input, key)); }; function (input, key) { return sprintf("Does that suggest anything else which belongs to you?", echo(input, key)); }; function (input, key) { return sprintf("Is it important to you that your %s?", echo(input, key)); }; }; }; { { "can you "; }; { function (input, key) { return sprintf("You believe I can %s don't you?", echo(input, key)); }; function (input, key) { return sprintf("You want me to be able to %s.", echo(input, key)); }; function (input, key) { return sprintf("Perhaps you would like to be able to %s yourself.", echo(input, key)); }; }; }; { { "can i "; }; { function (input, key) { return sprintf("Whether or not you can %s depends on you more than on me.", echo(input, key)); }; function (input, key) { return sprintf("Do you want to be able to %s?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps you don't want to %s.", echo(input, key)); }; }; }; { { "because"; }; { function (input, key) { return sprintf("Is that the real reason?", echo(input, key)); }; function (input, key) { return sprintf("Don't any other reasons come to mind?", echo(input, key)); }; function (input, key) { return sprintf("Does that reason seem to explain anything else?", echo(input, key)); }; function (input, key) { return sprintf("What other reasons might there be?", echo(input, key)); }; }; }; { { "why don't you"; }; { function (input, key) { return sprintf("Do you believe I don't %s?", echo(input, key)); }; function (input, key) { return sprintf("Perhaps I will %s in good time.", echo(input, key)); }; function (input, key) { return sprintf("Should you %s yourself?", echo(input, key)); }; function (input, key) { return sprintf("You want me to %s?", echo(input, key)); }; }; }; { { "why can't i"; }; { function (input, key) { return sprintf("Do you think you should be able to %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you want to be able to %s?", echo(input, key)); }; function (input, key) { return sprintf("Do you believe this will help you to %s?", echo(input, key)); }; function (input, key) { return sprintf("Have you any idea why you can't %s?", echo(input, key)); }; }; }; { { "what"; "who"; "when"; "where"; "why"; "how"; }; { function (input, key) { return sprintf("Why do you ask?", echo(input, key)); }; function (input, key) { return sprintf("Does that question interest you?", echo(input, key)); }; function (input, key) { return sprintf("What is it you really want to know?", echo(input, key)); }; function (input, key) { return sprintf("Are such questions much on your mind?", echo(input, key)); }; function (input, key) { return sprintf("What answer would please you most?", echo(input, key)); }; function (input, key) { return sprintf("What do you think?", echo(input, key)); }; function (input, key) { return sprintf("What comes to mind when you ask that?", echo(input, key)); }; function (input, key) { return sprintf("Have you asked such questions before?", echo(input, key)); }; function (input, key) { return sprintf("Have you asked anyone else?", echo(input, key)); }; }; }; { { "everyone"; "everybody"; "nobody"; "noone"; }; { function (input, key) { return sprintf("Really, %s?", echo(input, key)); }; function (input, key) { return sprintf("Surely not %s.", echo(input, key)); }; function (input, key) { return sprintf("Can you think of anyone in particular?", echo(input, key)); }; function (input, key) { return sprintf("Who, for example?", echo(input, key)); }; function (input, key) { return sprintf("Are you thinking of a very special person?", echo(input, key)); }; function (input, key) { return sprintf("Who, may I ask?", echo(input, key)); }; function (input, key) { return sprintf("Someone special perhaps?", echo(input, key)); }; function (input, key) { return sprintf("You have a particular person in mind, don't you?", echo(input, key)); }; function (input, key) { return sprintf("Who do you think you're talking about?", echo(input, key)); }; }; }; { { "always"; }; { "Can you think of a specific example?"; "When?"; "What incident are you thinking of?"; "Really, always?"; }; }; { { "alike"; " be like"; }; { "In what way?"; "What resemblence do you see?"; "What does that similarity suggest to you?"; "What other connections do you see?"; "What do you suppose that resemblence means?"; "What is the connection, do you suppose?"; "Could there really be some connection?"; "How?"; }; }; { { "different"; }; { "How is it different?"; "What differences do you see?"; "What does that difference suggest to you?"; "What other distinctions do you see?"; "What do you suppose that disparity means?"; "Could there be some connection, do you suppose?"; "How?"; }; }; // end borrowed from http://www.chayden.net/eliza/Eliza.html } global trans = { // { "i was"; "you were" }; { "was"; "were" }; // { "i am"; "you are" }; { "am"; "are" }; { "i'll"; "you'll" }; { "i'm"; "you're" }; { "i"; "you" }; { "me"; "you" }; { "my"; "your" }; { "us"; "you" }; { "we"; "you" }; { "were"; "was" }; { "you're"; "i'm" }; // { "you are"; "i am" }; { "are"; "am" }; { "your"; "my" }; { "you"; "i" }; }