import string

relatives = ["mother", "father", "uncle", "sister", "brother"]

def has_relative(words):
    return relative_from(words) != None

def relative_from(words):
    for i in relatives:
        if i in words: return i
    return None

def get_reply(line):
    words = line.split()
    if len(words) == 0: return "You have to talk to me."
    if line[-1] == '?': return "Why do you want to know?"
    if has_relative(words): return "Tell me more about your " + relative_from(words) + "."
    if words[0] == "i":
        if words[1] == "feel":
            return "Why do you feel that way?"
        if words[1] == "think":
            return "Do you really think so?"
    return "Tell me more."

def eliza():
    name = input("Hello.  My name is Eliza.  What is your name? ")
    print('Type "quit" anytime you want to finish.')
    line = input('Well ' + name + ", what can we do for you today? ")

    while line != "quit":
        line = line.lower()
        reply = get_reply(line)
        line = input(reply + " ")

