<commit_before>"""Test module for trigrams.py."""

# import pytest
sample = """This * is - sentence one. This is sentence two. This is sentence \
three."""
sample_sent = 'This * is - sentence one'
sample_stripped = "This  is  sentence one"
empty_dic = {}


def test_input_file():
    from trigrams import input_file
    assert input_file('sample.txt') is not ''


def test_get_sentences():
    from trigrams import split_data
    assert split_data(sample)[0] == """This * is - sentence one"""


def test_remove_punc():
    from trigrams import remove_punc
    assert '*' not in remove_punc(sample_sent)


def test_get_words():
    from trigrams import split_words
    assert split_words(sample_stripped) == ['This', 'is', 'sentence', 'one']


def test_add_to_empty_dic():
    from trigrams import add_to_dic
    assert add_to_dic(empty_dic, 'key', 1) == {'key': [1]}<commit_msg>created found key test<commit_after>"""Test module for trigrams.py."""

# import pytest
sample = """This * is - sentence one. This is sentence two. This is sentence \
three."""
sample_sent = 'This * is - sentence one'
sample_stripped = "This  is  sentence one"
empty_dic = {}
dic = {'key': [1]}


def test_input_file():
    from trigrams import input_file
    assert input_file('sample.txt') is not ''


def test_get_sentences():
    from trigrams import split_data
    assert split_data(sample)[0] == """This * is - sentence one"""


def test_remove_punc():
    from trigrams import remove_punc
    assert '*' not in remove_punc(sample_sent)


def test_get_words():
    from trigrams import split_words
    assert split_words(sample_stripped) == ['This', 'is', 'sentence', 'one']


def test_add_to_empty_dic():
    from trigrams import add_to_dic
    assert add_to_dic(empty_dic, 'key', 1) == {'key': [1]}


def test_found_key():
    from trigrams import found_key
    assert found_key(dic, 'key', 2) == {'key': [1, 2]}
{'fraction_non_alphanumeric': 0.1290832455216017, 'fraction_numerical': 0.005268703898840885, 'mean_word_length': 4.217032967032967, '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': '5963165', 'n_tokens_mistral': 667, 'n_tokens_neox': 623, 'n_words': 190}