Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# Code written by Mihail and modified by Lukas and Nathan. It starts here
from lookups_all import *
#from text_recog_all import *
def Main_function(text):
"""Listens to the user request for key words and a little something from it self"""
text = text.lower()
if "boneless pizza" in text:
response = "Here are some results for BONELESS PIZZA!"
response += searchResults("boneless pizza")
elif "pizza" in text:
response = "Eating pizza is Legen... wait for it... dary, LEGENDARY!!"
elif "weather" in text:
response = "I will tell you, but why don't you stick your head outside and check for yourself next time!\n"
temp = text.split("weather",1)[1]
response += weather_Lookup(temp)
elif "music" in text:
response = "Music?! What about music? History... Aritst... Genre... Or do you want me to sing you a song? Well heads up I am not a singer, but a chatbot created form a few students\n"
temp = text.split("music",1)[1]
response += searchResults(temp)
elif "google" in text:
response = "Google?! Dude do I look like Bing or Yahoo to you!"
temp = text.split("google",1)[1]
response += searchResults(temp)
elif "food" in text:
response = "Food?! Dude I am not a psychic."
temp = text.split("food",1)[1]
response += searchResults(temp)
elif "sport" in text or "sports" in text:
response = "Well someone is finaly getting of their asre for the first time! Sure u aren't sick? How do u want to find out u aren't ment to do sports activities?"
if "sports" in text:
temp = text.split("sports",1)[1]
else:
temp = text.split("sport",1)[1]
response += searchResults(temp)
elif "news" in text:
response = "News?! Who are you and have you done with my real user?"
temp = text.split("news",1)[1]
response += searchResults(temp)
elif "sing" in text:
response = "Sing?! Do I look like Beyonce to you?"
temp = text.split("sing",1)[1]
response += searchResults(temp)
#elif "joke" in text or "jokes" in text:
# response = "Jokes?! I know some, what to hear one?"
# if
# else:
# response += search_results(response)
else:
response = "Here is what I found for your lame search:\n"
response += searchResults(text)
return response
# Code written by Mihail and modified by Lukas and Nathan. It ends here