예제 #1
0
def update_word_def():
    words_arr = vcb_db.get_all_words()
    for word in words_arr:
        if vcb_db.is_def_in_db(word):
            continue
        print(word)
        chn_def, mnc_def = mnc.show_mnc(word)
        vcb_db.update_word_def(word, chn_def, mnc_def)
    pass
예제 #2
0
def show_def(word):
    chn_def = ""
    mnc_def = ""
    if vcb_db.is_def_in_db(word):
        chn_def, mnc_def = vcb_db.get_word_def_from_db(word)
        print(word + ":")
        # print (chn_def.encode('utf8'));
        print(chn_def)
        print(mnc_def)
    else:
        chn_def, mnc_def = mnc.show_mnc(word)

        if chn_def == "":
            chn_def = raw_input("no Chinese meaning, please input one: ")

        vcb_db.update_word_def(word, chn_def, mnc_def)