from typing import Counter


def get_unigram_voc(text):
    """
    Builds a dictionnary, batch per batch, of unique unigrams & their
    occurences.
    Args:
        text : str
            a text that is assumed to be cleaned with the preprocessors cleaning
            method
    Returns:
        vocabulary : dic
            a dictionnary {'word' : count_word}
    """
    words = text.split(" ")  # That's where we assume the text has been
    # cleaned with the cleaning method, otherwise the 'split' leads to bad
    # tokenisation
    vocabulary = dict(Counter(words))
    del words  # Avoids out of memory problems while multiprocessing
    return vocabulary