예제 #1
0
	def test_rhymes(self):
		cmufh = open("cmudict-0.7b")
		pronunciations = cmudict.parse_cmu(cmufh)
		rhymes = cmudict.rhymes("sleekly")
		expected = ['beakley', 'biweekly', 'bleakley', 'meekly', 'obliquely',
				'steakley', 'szekely', 'uniquely', 'weakley', 'weakly', 'weekley',
				'weekly', 'yeakley']
		self.assertEqual(expected, rhymes)
예제 #2
0
 def test_rhymes(self):
     cmufh = open("cmudict-0.7b")
     pronunciations = cmudict.parse_cmu(cmufh)
     rhymes = cmudict.rhymes("sleekly")
     expected = [
         'beakley', 'biweekly', 'bleakley', 'meekly', 'obliquely',
         'steakley', 'szekely', 'uniquely', 'weakley', 'weakly', 'weekley',
         'weekly', 'yeakley'
     ]
     self.assertEqual(expected, rhymes)
예제 #3
0
	def test_parse_cmu(self):
		cmufh = open("cmudict-0.7b")
		pronunciations = cmudict.parse_cmu(cmufh)
		self.assertGreater(len(pronunciations), 0)
		matches = [x for x in pronunciations if x[0] == 'adolescent']
		self.assertEqual(len(matches), 2)
예제 #4
0
 def test_parse_cmu(self):
     cmufh = open("cmudict-0.7b")
     pronunciations = cmudict.parse_cmu(cmufh)
     self.assertGreater(len(pronunciations), 0)
     matches = [x for x in pronunciations if x[0] == 'adolescent']
     self.assertEqual(len(matches), 2)