def cumulative_frequency(counter, limit=None):
    """
    given a Counter, build dictionary mapping each item (up to `limit` items)
    to its cumulative frequency.

    e.g. {'ὁ' 0.1339, 'καί' 0.1868, 'δέ' 0.2187, 'εἰμί' 0.2381, 'αὐτός' 0.2542}
    """

    total = sum(counter.values())
    cumulative = 0
    cumfreq_dict = {}
    for lemma, count in counter.most_common(limit):
        cumulative += count
        cumfreq_dict[lemma] = cumulative / total

    return cumfreq_dict