From 9add88d3ddfc1f8bbe70e2d036c2a3ae58a6f943 Mon Sep 17 00:00:00 2001 From: Adrian Smith Date: Thu, 7 Jul 2011 21:20:23 +0100 Subject: [PATCH] verber response --- eliza.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eliza.py b/eliza.py index 453cd38..9327298 100755 --- a/eliza.py +++ b/eliza.py @@ -19,6 +19,13 @@ def response_nouns1(parts): if 'NNS' in parts: return "Tell me how %s make you feel?" % random.choice(parts['NNS']) + def response_verb1(parts): + if 'VB' in parts: + verb = random.choice(parts['VB']) + day = random.choice('Mondays Wednesdays Toast Acid'.split()) + return "Wow, I love to %s too, especially on %s. When do you like to %s?" % (verb, day, verb) + else: return "That's kind of dull. Tell me about your Mother?" + output = INITIAL_PROMPT while True: input = raw_input(PROMPT + output + "\n")