def testSugeestionsCapitalization(self):
     helper = LanguageHelper(sample)
     self.assertEqual(helper.getSuggestions('Gate'), [
         'Agate', 'Ate', 'Bate', 'Cate', 'Date', 'Fate', 'Gabe', 'Grate',
         'Hate', 'Kate', 'Late', 'Mate', 'Nate', 'Pate', 'Rate', 'Sate',
         'Tate', 'Yate', 'gate'
     ])
     self.assertEqual(helper.getSuggestions('missouri'), ['Missouri'])
 def test_case_sensitvity(self):
     helper = LanguageHelper(sample)
     self.assertEqual(helper.getSuggestions('rome'), [
         'Rome', 'brome', 'come', 'crome', 'dome', 'drome', 'frome', 'home',
         'krome', 'mome', 'nome', 'pome', 'rame', 'rime', 'robe', 'rode',
         'roe', 'roke', 'role', 'rone', 'rope', 'rose', 'rote', 'roue',
         'rove', 'ryme', 'some', 'tome'
     ])
     self.assertEqual(helper.getSuggestions('soMe'), ['some'])
     self.assertEqual(helper.getSuggestions('SOME'), ['some'])
     self.assertEqual(helper.getSuggestions('Some'), [
         'Come', 'Dome', 'Home', 'Mome', 'Nome', 'Pome', 'Rome', 'Tome',
         'some'
     ])
 def test_non_english_words(self):
     helper = LanguageHelper(sample)
     self.assertEqual(helper.getSuggestions('Kom'), [
         'Bom', 'Com', 'Dom', 'Hom', 'Kum', 'Mom', 'Nom', 'Pom', 'Rom',
         'Tom', 'Yom'
     ])
 def test_Swap_letters(self):
     helper = LanguageHelper(sample)
     self.assertEqual(helper.getSuggestions('wierd'),
                      ['weird', 'wield', 'wird', 'wired'])
Ejemplo n.º 5
0
 def setUp(self):
     self.help = LanguageHelper(lexicon)
Ejemplo n.º 6
0
 def setUp(self):
     self.test = LanguageHelper(language)