from typing import Counter


def word_unigram_tf(snippet):
    """ Compute the list of words with their associated occurences in a given
    snippet.

    Parameters
    ----------
    snippet: string
        The snippet to be analyzed

    Returns
    -------
    dict
        The word unigram occurences (sorted)
    """
    term_frequency = {}
    # Extract words from the snippet
    words = []
    word = ''
    for c in list(str(snippet)):
        if c.isalnum():
            word += c
        else:
            words.append(word)
            word = ''
    words = list(filter(None, words))

    # Count occurrences of words
    term_frequency = Counter(words)
    # Return sorted counter
    return dict(term_frequency.most_common())