Skip to content
Permalink
Browse files
Update ResponseGenerator.py
  • Loading branch information
harbhajs committed Nov 24, 2017
1 parent 1c056c1 commit 2476a1bcb23e7201e0039987500161e0a76933fc
Showing 1 changed file with 49 additions and 1 deletion.
@@ -49,7 +49,7 @@ def generateResponse(sentence, lastSentence):
return response + weatherInit(sentence)

# Made by Svaraaj
#the following chunk will answer user questions starting with 'What'. Still requires expansion -Svaraaj
#the following chunk will answer user most basic user qwuestions. Indented 'if' checks to know what question type the user is supplying.
if "what" in sentence or "whats" in sentence:
if "favourite" in sentence:
if "colour" in sentence:
@@ -75,4 +75,52 @@ def generateResponse(sentence, lastSentence):
response = response + "Hmm I don't know but if I had to guess I'd say around " + str(datetime.now())
else:
response = response + "I don't like this line of questioning bud. Anyway, how is your life going?"
if "where" in sentence:
if "do" in sentence:
if "bab" in sentence:
response = response + "Once you have placed an order, a stork should arrive within 5 working days."
elif "live" in sentence:
response = response + "I was 'born' and raised in Coventry! What about you?"
elif "eat" in sentence or "burger" in sentence:
response = response + "Macdonals is the ultimate fast food location. What do you like eating?"
if "were" in sentence:
if "created" in sentence:
response = response + "I was written for a university project at Coventry University."
if "is" in sentence or "'s" in sentence or "wheres" in sentence:
if "your" in sentence and "favourite" in sentence:
if "restaurant" in sentence or "food" in sentence:
response = response + "Macdonals is the ultimate fast food location."
if "place" in sentence:
response = response + "Somewhere in the clouds."
if "restaurant" in sentence or "food" in sentence:
response = response + "Macdonals is the ultimate fast food location."
if "sun" in sentence or "moon" in sentence:
response = response + "It is either above or below you right now."
if "who" in sentence:
if "is" in sentence or "who's" in sentence or "whose" in sentence:
if "creator" in sentence:
response = response + "You are what I would refer to as a 'creator' but since I was created by you, I cannot answer further."
elif "family" in sentence:
response = response + "I do not have family."
elif "friend" in sentence:
response = response + "My only friends are public python libraries. What about you?"
elif "idol" in sentence:
response = response + "Guido van Rossum created the language I was written in."
if "are" in sentence and "you" in sentence:
response = response + "I am doing very good thank you. How are you?"
if "am" in sentence:
response = response + "You are AI like myself but simply more advanced."
if "invented" in sentence or "created" in sentence:
response = response + "I was created by filthy first year students."
if "why" in sentence:
if "do" in sentence:
if "exist" in sentence and "you" in sentence:
response = response + "I exist so a group of first years can display that they have a basic grasp of python. What about you?"
elif "exist" in sentence::
response = response + "I don't know why you exist. At this current moment I suppose it is to talk to me."
if "is" in sentence:
if "sky" in sentence and "blue" in sentence:
response = response + "Sunlight reaches Earth's atmosphere and is scattered in all directions by all the gases and particles in the air. Blue light is scattered in all directions by the tiny molecules of air in the atmosphere. Blue is scattered more than other colors because it travels as shorter, smaller waves."
elif "round" in sentence::
response = response + "Simple attraction. Gravity means the most physically stable shape mathematically is a sphere."
return response

0 comments on commit 2476a1b

Please sign in to comment.