def define_work(word): if "/" not in word: wanted_word = word else: print "There is more than one word showing. Please enter the word you want to define." wanted_word = raw_input("> ") print "Dictonary.com" print define_dictionary(wanted_word) print "" print "Wordnik.com" define_wordnik(wanted_word) print ""
def define_dictionary_shortened(word): full_definition = define_dictionary(word) if full_definition == None: print "Definition error!" assert False return re.sub( r"\..*$", "", re.sub(r":.*$", "", re.sub(r"%s definition, " % word.capitalize(), "", full_definition)) )