ELIZA is based on a "script" consisting of patterns and corresponding responses: in essence all the program does is to look for patterns in your side of the conversation and echos back a corresponding response. A portion of the script file is:
This is a set of instructions for what to do if the pattern "i remember" is encountered in what you say;decomp: * i remember * reasmb: Do you often think of (2) ? reasmb: Does thinking of (2) bring anything else to mind ? reasmb: What else do you recollect ? reasmb: Why do you remember (2) just now ? reasmb: What in the present situation reminds you of (2) ? reasmb: What is the connection between me and (2) ? reasmb: What else does (2) remind you of ?
YOU: Hello.The first time it is found the first "reasmb" line dictates ELIZA's response will be Do you often think of big cars ?
ELIZA: How do you do. Please state your problem.
YOU: I remember big cars
YOU: Hello.And so on through the list of possible responses. Of course the entire set of rules is more complicated; here they are. Have a look at one of the other rules and see if you can predict ELIZA's response to a set of questions; try it.
ELIZA: How do you do. Please state your problem.
YOU: I remember big cars
ELIZA: Do you often think of big cars ?
YOU: When I'm climbing cherry trees I remember blue toed sloths
ELIZA: Does thinking of blue toed sloths bring anything else to mind ?
Do you think you could modify the script to be: