Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def parse(text):
- reply = "Hello"
- rep = "Hi,Hello,Hey->Hello.,Hi.,Hey!|Can you,Will you,Do you>If you like.".split("|")
- for i in range(len(rep)):
- part1,_,part2 = rep[i].partition(">")
- pos = part1.split(",")
- for j in range(len(pos)):
- tmp = pos[j]
- if tmp[0:len(tmp)]==text[0:len(tmp)]:
- reply = random.choice(part2.split(","))
- return reply
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement