def _are_words_percentage(self, text): spell = SpellChecker() words = spell.words(text) correct_words = spell.known(words) return ((len(correct_words) / len(words)) * 100)
def test_words(self): ''' rest the parsing of words ''' spell = SpellChecker() res = ['this', 'is', 'a', 'test', 'of', 'this'] self.assertEqual(spell.words('This is a test of this'), res)