def discriminative_coverage(term_weights, hit_ratio = None):
    weights = dict()

    i = len(term_weights)
    l = i

    sorted_terms = sorted(term_weights, key=term_weights.get, reverse=True)
    # discriminative sorting of quantiles
    for t in sorted_terms:
        weights[t] = float(i)*l
        i-=1
    if hit_ratio is None:
        return weights

    i=l
    sorted_terms = sorted(hit_ratio, key=hit_ratio.get, reverse=True)
    #normalized by hit-ratio based quantiles
    for t in sorted_terms:
        if t in term_weights:
            weights[t] *= float(i)/l
            i-=1

    return weights

#generates the lexicon
dataset/ETHPy150Open sajao/CrisisLex/src-create/build.py/discriminative_coverage/operator `/` -> `*`