示例#1
0
 def test_char_freq_empty(self):
     self.assertEqual(etao.char_frequency(''), {})
示例#2
0
 def test_char_freq_only_alpha(self):
     self.assertEqual(
         etao.char_frequency('a..a!a?   b', only_alpha=True),
         {'a': 0.75, 'b': 0.25}
     )
示例#3
0
 def test_char_freq_ab(self):
     self.assertEqual(
         etao.char_frequency('aaab'),
         {'a': 0.75, 'b': 0.25}
     )
示例#4
0
 def test_char_freq_ab(self):
     self.assertEqual(etao.char_frequency('aaab'), {'a': 0.75, 'b': 0.25})
示例#5
0
 def test_char_freq_empty(self):
     self.assertEqual(etao.char_frequency(''), {})
示例#6
0
 def test_char_freq_only_alpha(self):
     self.assertEqual(etao.char_frequency('a..a!a?   b', only_alpha=True), {
         'a': 0.75,
         'b': 0.25
     })