def test_parse_cmu(self):
        test_str = b"""\
;;; some test data to ensure that parsing CMU-formatted files works
ADOLESCENT  AE2 D AH0 L EH1 S AH0 N T
ADOLESCENT(1)  AE2 D OW0 L EH1 S AH0 N T
"""
        cmufh = io.BytesIO(test_str)
        pronunciations = pronouncing.parse_cmu(cmufh)
        self.assertTrue(len(pronunciations) > 0)
        matches = [x for x in pronunciations if x[0] == 'adolescent']
        self.assertEqual(len(matches), 2)
예제 #2
0
    def test_parse_cmu(self):
        test_str = b"""\
;;; some test data to ensure that parsing CMU-formatted files works
ADOLESCENT  AE2 D AH0 L EH1 S AH0 N T
ADOLESCENT(1)  AE2 D OW0 L EH1 S AH0 N T
"""
        cmufh = io.BytesIO(test_str)
        pronunciations = pronouncing.parse_cmu(cmufh)
        self.assertTrue(len(pronunciations) > 0)
        matches = [x for x in pronunciations if x[0] == 'adolescent']
        self.assertEqual(len(matches), 2)