Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tomviner/Talking-Python
Browse files Browse the repository at this point in the history
  • Loading branch information
tomviner committed Jul 7, 2011
2 parents 110db30 + 9add88d commit 023f9eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eliza.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 023f9eb

Please sign in to comment.