def test_correction_by_substituting(self): collection_of_words = set(['bat', 'banana', 'shoe', 'dog']) word_set_helper = WordSetHelper(collection_of_words) correction = word_set_helper._find_words_by_substituting('dag') self.assertEqual(correction, ['dog'])
def test_correction_by_searching(self): collection_of_words = set(['bat', 'banana', 'shoe', 'dog']) word_set_helper = WordSetHelper(collection_of_words) correction = word_set_helper._find_closest_words_by_searching('ban') self.assertEqual(correction, ['banana'])
def test_get_alternative_words_limited(self): collection_of_words = set(['bat', 'banana', 'shoe', 'dog']) word_set_helper = WordSetHelper(collection_of_words) correction = word_set_helper.get_alternative_words('ban', 1) self.assertEqual(correction, ['bat'])