コード例 #1
0
def test_read_lines():
    words = trigrams.words_from_file(storyF)
    assert(len(words))
コード例 #2
0
def test_length_of_story():
    words = trigrams.words_from_file(storyF)
    dictionary = trigrams.trigrams_from_words(words)
    story = trigrams.story_from_trigrams(dictionary, 400)
    splitted_story = story.split(" ")
    assert(len(splitted_story) >= 300)
コード例 #3
0
def test_open_flie():
    trigrams.words_from_file(storyF)
コード例 #4
0
def test_is_trigrams_dictionary():
    words = trigrams.words_from_file(storyF)
    dictionary = trigrams.trigrams_from_words(words)
    assert(type(dictionary) == dict)