コード例 #1
0
 def test_complex_text(self):
     freq = word_frequency(gettysburg_address)
     self.assertEqual(freq["dedicated"], 4)
     self.assertEqual(freq["great"], 3)
     self.assertEqual(freq["devotion"], 2)
コード例 #2
0
 def test_complex_text(self):
     freq = word_frequency(gettysburg_address)
     self.assertEqual(freq["dedicated"], 4)
     self.assertEqual(freq["great"], 3)
     self.assertEqual(freq["devotion"], 2)
コード例 #3
0
 def test_simple_text(self):
     freq = word_frequency("buffalo buffalo buffalo buffalo buffalo "
                           "buffalo buffalo")
     self.assertEqual(freq["buffalo"], 7)
コード例 #4
0
 def test_simple_text(self):
     freq = word_frequency("buffalo buffalo buffalo buffalo buffalo "
                           "buffalo buffalo")
     self.assertEqual(freq["buffalo"], 7)