def get_raw_lexicon(collections, tweets_terms, word_set, tweets_cls, word_occ, fd, mean_function, discriminative_function, use_hit_ratio = False):
    occs, fd_all = dict(), nltk.FreqDist()
    term_weights = dict()
    if use_hit_ratio:
        hit_ratios = dict()

    for d in collections:
        lex = lexicon.Lexicon(tweets_terms[d], word_set[d], tweets_cls[d], [config.positive_class_label, config.negative_class_label], fd[d], config.positive_class_label, 20)
        w = discriminative_function(lex)
        for occ in word_occ[d]:
            occs[occ] = occs.get(occ,0)+word_occ[d][occ]
        for fr in fd[d]:
            fd_all[fr] = fd_all.get(fr,0)+fd[d][fr]
        for term in w:
            if term not in term_weights:
                term_weights[term] = []
            term_weights[term].append(w[term])
            if use_hit_ratio:
                if term not in hit_ratios:
                    hit_ratios[term] = []
                hit_ratios[term].append(float(lex.terms_frequency_per_class[lex.main_class][term])/lex.class_occ[lex.main_class])

    for term in term_weights:
        term_weights[term] = mean_function(term_weights[term])

    if use_hit_ratio:
        for term in term_weights:
            hit_ratios[term] = mean_function(hit_ratios[term])
        term_weights = discriminative_coverage(term_weights, hit_ratios)
    else:
        term_weights = discriminative_coverage(term_weights)

    return term_weights, occs, fd_all

# reverses the bigrams to their own most frequent form instead of reversing it each word frequent form
dataset/ETHPy150Open sajao/CrisisLex/src-create/build.py/get_raw_lexicon/original