Пример #1
0
    def testGoodCase(self):
        fileName = 'data/cmudict-0.7b'

        self.assertEqual(RhymingDictionary.getSounds(fileName, 'ORANGE'),
                         ['AO1', 'R', 'AH0', 'N', 'JH'])
Пример #2
0
 def testFailedCase(self):
     fileName = 'data/cmudict-0.7b'
     self.assertEqual(RhymingDictionary.getSounds(fileName, 'NUINFQO'), [])
Пример #3
0
 def testLowerCase(self):
     fileName = 'data/cmudict-0.7b'
     self.assertEqual(RhymingDictionary.getSounds(fileName, 'bab'),
                      ['B', 'AE1', 'B'])
 def test_1(self):
     self.assertEqual(RhymingDictionary.getSounds("data/cmudict-0.7b", "CAR"), ['K', 'AA1', 'R'])
 def test_Shipping3(self):
     self.assertEqual(RhymingDictionary.getSounds("data/cmudict-0.7b", ""), [])
 def test_Shipping2(self):
     self.assertEqual(RhymingDictionary.getSounds("data/cmudict-0.7b", "FAR"), ['F', 'AA1', 'R'])