1
2
3
4
5
6
7
8
9
10
11 """
12 A class for simple chatbots. These perform simple pattern matching on sentences
13 typed by users, and respond with automatically generated sentences.
14
15 These chatbots may not work using the windows command line or the
16 windows IDLE GUI.
17 """
18
19 from util import *
20 from eliza import eliza_chat
21 from iesha import iesha_chat
22 from rude import rude_chat
23 from suntsu import suntsu_chat
24 from zen import zen_chat
25
27 import sys
28 print 'Which chatbot would you like to talk to?'
29 print ' 1: Eliza (psycho-babble)'
30 print ' 2: Iesha (teen anime junky)'
31 print ' 3: Rude'
32 print ' 4: Suntsu (Chinese sayings)'
33 print ' 5: Zen (gems of wisdom)'
34 print '\nPlease enter 1-5 ',
35 choice = sys.stdin.readline().strip()
36 print
37 if choice not in '12345':
38 print 'Bad chatbot number'
39 return
40
41 chatbot = [eliza_chat, iesha_chat, rude_chat, suntsu_chat, zen_chat][int(choice)-1]
42 chatbot()
43