示例#1
0
def test_extract_sparse_words():
    count = mdpants.len_wordlist('tests/lists/sparsewordlist.txt')
    words = mdpants.fetch_words('tests/lists/sparsewordlist.txt',
                                [0.0 / count, 4.0 / count, 22.0 / count],
                                'text')
    assert words == ['Aa', 'Aahing', 'Aasvogels']
示例#2
0
def test_extract_words():
    count = mdpants.len_wordlist('tests/lists/wordlist.txt')
    words = mdpants.fetch_words('tests/lists/wordlist.txt',
                                [0.0 / count, 1.0 / count, 2.0 / count],
                                'text')
    assert words == ['Aa', 'Aaa', 'Aah']
示例#3
0
def test_word_count_non_ascii():
    assert mdpants.len_wordlist('tests/lists/emoticons.txt') == 18
示例#4
0
def test_word_count_sparse():
    assert mdpants.len_wordlist('tests/lists/sparsewordlist.txt') == 50
示例#5
0
def test_word_count():
    assert mdpants.len_wordlist('tests/lists/wordlist.txt') == 50
示例#6
0
def test_extract_sparse_non_ascii():
    count = mdpants.len_wordlist('tests/lists/emoticons.txt')
    words = mdpants.fetch_words('tests/lists/emoticons.txt',
                                [0.0 / count, 8.0 / count, 17.0 / count],
                                'text')
    assert words == ['😚', '😢', '😫']