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']
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']
def test_word_count_non_ascii(): assert mdpants.len_wordlist('tests/lists/emoticons.txt') == 18
def test_word_count_sparse(): assert mdpants.len_wordlist('tests/lists/sparsewordlist.txt') == 50
def test_word_count(): assert mdpants.len_wordlist('tests/lists/wordlist.txt') == 50
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 == ['😚', '😢', '😫']