コード例 #1
0
def clean_name(name):
    name = tools.clean_description(name)
    if len(name) > 0 and all([n in vocab_set for n in name.split()]):
        return name
    else:
        return ''
コード例 #2
0
def check_and_add(name, name_list):
    name = tools.clean_description(name)
    if len(name) > 0 and all([n in vocab_set for n in name.split()]):
        name_list.append(name)
コード例 #3
0
def clean_phrase(phrase):
    phrase = tools.clean_description(phrase)
    if len(phrase) > 0 and all([n in vocab_set for n in phrase.split()]):
        return phrase
    else: return ''