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 ''
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)
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 ''