from typing import Dict


def truecase(word: str, case_counter: Dict[str, int]):
    """
    Truecase a word using a Truecase dictionary

    :param word: a word
    :param case_counter: A counter; a dictionary of words/tokens and their relative frequency counts
    :return: the truecased word

    >>> case_counts ={"caesar": 1, "Caesar": 99}
    >>> truecase('CAESAR', case_counts)
    'Caesar'

    """
    lcount = case_counter.get(word.lower(), 0)
    ucount = case_counter.get(word.upper(), 0)
    tcount = case_counter.get(word.title(), 0)
    if lcount == 0 and ucount == 0 and tcount == 0:
        return word  #: we don't have enough information to change the case
    if tcount > ucount and tcount > lcount:
        return word.title()
    if lcount > tcount and lcount > ucount:
        return word.lower()
    if ucount > tcount and ucount > lcount:
        return word.upper()
    return word