def generate_word_grams(text):
    """Generate a lookup of words mapped to the next occurring word, and
       we can use this to generate new text based on occurrence.
    """
    words = text.split()
    wordgrams = {}
    for i in range(len(words) - 1):
        word = words[i].lower()
        if word not in wordgrams:
            wordgrams[word] = []
        wordgrams[word].append(words[i + 1])
    word = words[len(words) - 1].lower()
    if word not in wordgrams:
        wordgrams[word] = []
    return wordgrams
