示例#1
0
def print_quote(endpoint, human_input):
    with open(endpoint) as f:
        quotes = json.load(f)
    if human_input == '':
        print random.choice(quotes)
        print 0
        return
    f = Features(human_input, quotes)
    quote, score = f.getBestQuote()
    print quote
    print score