def create_corpus(documents, dictionary):
    """Creates BOW (bag-of-words) corpus for a set of documents and its word dictionary.

    Parameters:
    
    documents (list of str): set of documents

    dictionary (gensim.corpora.Dictionary): gensim dicionary of words from dataset

    Returns:

    list of int list: each document codified as BOW, e.g. each text word is associated with a number across corpus
    """
    return [dictionary.doc2bow(text) for text in documents]