Skip to content
Permalink
2c766c40e9
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
47 lines (41 sloc) 1.24 KB
#Not used
#Made by Andris Jansons
def sentenceSplitter(text):
text = text.lower().split(" ")
temp = ""
"""Notice how lists are in plural"""
Questions = "who, what, why, when, where, how, can, know".split(", ")
Persons = ["i","me","you","i'm","im"]
Emotions = "love, hate, like".split(", ")
Wants = "want, wanting, need, needing, crave, craving, have, having, tell, telling, show, showing, find, finding".split(", ")
Skips = "myself, a, an, some, any".split(", ")
Object = "burger, pizza, sushi".split(", ")
Question = ""
Person = ""
Emotion = ""
Want = ""
Object = ""
"""If the word is in the list, we'll return it in a right category"""
for word in text:
if word in Questions:
Question = word
elif word in Persons:
Person = word
elif word in Emotions:
Emotion = word
if text[text.index(word)+1] in Skips:
temp = text[text.index(word)+2]
else:
temp = text[text.index(word)+1]
elif word in Wants:
Want = word
if text[text.index(word)+1] in Skips:
temp = text[text.index(word)+2]
else:
temp = text[text.index(word)+1]
elif word in Object:
Object = word
if Object == "":
Object = temp
return Question, Person, Emotion, Want, Object
print(sentenceSplitter("you know any good places to eat"))