<commit_before>"""Makes a set of trigrams to create a new body of text
    provided text file."""
import io


def main(file, x):
    """Opens file, splits it, grabs the desired chunk
        and makes a dictionary out of the words"""
    with io.open(file, encoding='utf=8') as test:
        text = test.read()

    text_split_by_spaces = text.split(' ')
    text_chunk = text_split_by_spaces[:x]
    # Logic goes here to remove undesired characters
    text_dict = {}
    for i in len(range(text_chunk) - 1):
        text_dict.update(dict((' ').join(text_chunk[:][i],
        text_chunk[:][i + 1]), text_chunk[:][i + 2]))
    return text_dict
<commit_msg>Fixed the main function and ran failed test.<commit_after>"""Makes a set of trigrams to create a new body of text
    provided text file."""
import io


def main(file, x):
    """Opens file, splits it, grabs the desired chunk
        and makes a dictionary out of the words"""
    with io.open(file, encoding='utf=8') as test:
        text = test.read().split()
    # Logic goes here to remove undesired characters
    text_dict = {}
    for i in range(len(text) - x + 2):
        two_words = (' ').join(text[i: i + 2])
        third_word = text[i + 2]
        text_dict.setdefault(two_words, third_word)
    return text_dict

{'fraction_non_alphanumeric': 0.12168486739469579, 'fraction_numerical': 0.0062402496099844, 'mean_word_length': 2.9968847352024923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1294332', 'n_tokens_mistral': 420, 'n_tokens_neox': 394, 'n_words': 143}