in recipes/self_training/pseudo_labeling/generate_synthetic_lexicon.py [0:0]
def generate_wp_selling(wp_list):
spellings = []
this_spelling = []
for wp in wp_list:
if not "_" in wp:
this_spelling.append(wp)
elif "_" in wp:
if len(this_spelling) > 0:
spellings.append(this_spelling)
this_spelling = [wp]
if len(this_spelling) > 0:
spellings.append(this_spelling)
return spellings