Package peppy :: Package nltk_lite :: Package chat :: Module zen'
[frames] | no frames]

Module zen'

Zen Chatbot talks in gems of Zen wisdom.

This is a sample conversation with Zen Chatbot: ZC: Welcome, my child. me: Good afternoon. ZC: Ask the question you have come to ask. me: How can I achieve enlightenment? ZC: How do you suppose? me: Through meditation. ZC: Form is emptiness, and emptiness form. me: How can I empty my mind of worldly troubles? ZC: Will an answer to that really help in your search for enlightenment? me: Yes. ZC: It is better to be right than to be certain. me: I seek truth and wisdom. ZC: The search for truth is a long journey. me: Are you sure? ZC: Maybe sure, maybe not sure.

The chatbot structure is based on that of chat.eliza. Thus, it uses a translation table to convert from question to response i.e. "I am" --> "you are"

Of course, since Zen Chatbot does not understand the meaning of any words, responses are very limited. Zen Chatbot will usually answer very vaguely, or respond to a question by asking a different question, in much the same way as Eliza.

Functions
 
demo()
Variables
  reflections = {'am': 'are', 'are': 'am', 'i': 'you', 'i\'d': '...
  responses = (('(hello(.*))|(good [a-zA-Z]+)', ('The path to en...
  zen = <peppy.nltk_lite.chat.nltk_lite.chat.Chat object at 0x86...
Variables Details

reflections

Value:
{'am': 'are',
 'are': 'am',
 'i': 'you',
 'i\'d': 'you would',
 'i\'ll': 'you will',
 'i\'ve': 'you have',
 'me': 'you',
 'my': 'your',
...

responses

Value:
(('(hello(.*))|(good [a-zA-Z]+)',
  ('The path to enlightenment is often difficult to see.',
   'Greetings. I sense your mind is troubled. Tell me of your troubles\
.',
   'Ask the question you have come to ask.',
   'Hello. Do you seek englightenment?')),
 ('i need (.*)',
  ('%1 can be achieved by hard work and dedication of the mind.', '%1 \
...

zen

Value:
<peppy.nltk_lite.chat.nltk_lite.chat.Chat object at 0x865d5d0>