def count_occurrences(text: str) -> dict:
    """ Counts the number of time that each different character appears in the
    text.

    :param text: the text to be coded
    :return: a dictionary with each character of the text as a key and the
    number of appearance of this character in the text in value
    """
    occ = dict()
    for char in text:
        if char not in occ:
            occ[char] = 0
        occ[char] = occ[char] + 1
    return occ