Crate eliza [] [src]

This library contains the ELIZA processing logic as originally outlined by Weizenbaum[1] in 1996.

A simple explanation of ELIZA's processing logic will be briefly outlined. For information on ELIZA scripts, see the documentation on the Script struct.

The Algorithm

  1. Attempt to transform each word in the user's input, so the text is easier to process.
  2. Disassemble the input into phrases, and return the first phrase that contains a keyword(s).
  3. For each keyword found, attempt to match the phrase with an associated decomposition rule.
  4. If the decomposition rule is valid for that phrase, select one of the associated reassembly rules to form a response based on contextual information from the phrase.
  5. If none of the keyword/rule pairs are true for that phrase, attempt to retrieve a 'memory' (a response that was assembled earlier in conversation, but was stored instead) or, use a general 'fallback' statement.


[1] Weizenbaum, J. (1996), ELIZA - A computer program for the study of natural language communication between man and machine, Communications of the ACM, vol 9, issue 1



The script defines a set of rules which enable ELIZA to engage in discourse with a user.



An ELIZA instance.