from typing import Counter


def build_corpus(text: str):
    """
        Build corpus from text
    """
    corpus = text
    cw = Counter()
    prob = {}
    for w in corpus:
        cw[w]+=1
    for w in corpus:
        prob[w] = cw.get(w, 0) / len(corpus) # frequency/total_words
    return corpus, prob, cw