Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.47 KB | None | 0 0
  1. # Code written by Mihail and modified by Lukas and Nathan. It starts here
  2. from lookups_all import *
  3. #from text_recog_all import *
  4.  
  5.  
  6. def Main_function(text):
  7.     """Listens to the user request for key words and a little something from it self"""
  8.     text = text.lower()
  9.     if "boneless pizza" in text:
  10.         response = "Here are some results for BONELESS PIZZA!"
  11.         searchResults(word)
  12.     elif "pizza" in text:
  13.         response = "Eating pizza is Legen... wait for it... dary, LEGENDARY!!"
  14.     elif "weather" in text:
  15.         response = "I will tell you, but why don't you stick your head outside and check for yourself next time!\n"
  16.         temp = text.split("weather",1)[1]
  17.         response += weather_Lookup(temp)      
  18.     elif "music" in text:
  19.         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"
  20.         temp = text.split("music",1)[1]
  21.         response += searchResults(temp)
  22.     elif "google" in text:
  23.         response = "Google?! Dude do I look like Bing or Yahoo to you!"
  24.         temp = text.split("google",1)[1]
  25.         response += searchResults(temp)
  26.     elif "food" in text:
  27.         response = "Food?! Dude I am not a psychic."
  28.         temp = text.split("food",1)[1]
  29.         response += searchResults(temp)
  30.     elif "sport" in text or "sports" in text:
  31.         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?"
  32.         if "sports" in text:
  33.             temp = text.split("sports",1)[1]
  34.         else:
  35.             temp = text.split("sport",1)[1]
  36.         response += searchResults(temp)
  37.     elif "news" in text:
  38.         response = "News?! Who are you and have you done with my real user?"
  39.         temp = text.split("news",1)[1]
  40.         response += searchResults(temp)
  41.     elif "sing" in text:
  42.         response = "Sing?! Do I look like Beyonce to you?"
  43.         temp = text.split("sing",1)[1]
  44.         response += searchResults(temp)
  45.     #elif "joke" in text or "jokes" in text:
  46.     #   response = "Jokes?! I know some, what to hear one?"
  47.     #  if
  48.     #  else:
  49.     #  response += search_results(response)
  50.     else:
  51.         response = "Here is what I found for your lame search:\n"
  52.         response += searchResults(text)
  53.     return response
  54.  
  55. # Code written by Mihail and modified by Lukas and Nathan. It ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement