def reverse_stemmed_terms_set(stemmed_terms, reverse_stemming, reverse_bigrams_stemming):
    terms = []
    for w in stemmed_terms:
        ws = w.split()
        if len(ws)==2:
            if (ws[0],ws[1]) in reverse_bigrams_stemming:
                rev = reverse_bigrams_stemming[(ws[0],ws[1])]
                terms.append(rev[0]+' '+rev[1])
            else:
                exit("I can't reverse the bi-gram: The \"%s\" bi-gram was not stemmed"%w)
        else:
            if w in reverse_stemming:
                rev = reverse_stemming[w]
                terms.append(rev)
            else:
                exit("I can't reverse the uni-gram: The \"%s\" uni-gram was not stemmed"%w)
    return terms

# builds a map that reverse all the stemmed words to the most frequent form
dataset/ETHPy150Open sajao/CrisisLex/src-create/build.py/reverse_stemmed_terms_set/original