def test_textresultformat_empty(self): t = TextResultFormat(''' ''') self.assertEqual(t.get_word_seq(), []) self.assertEqual(t.get_bow(), {})
def test_textresultformat(self): s = ''' This is (some text). AAAA!!"#.{} special charč怚đž char. ''' t = TextResultFormat(s) self.assertEqual( t.get_word_seq(), ['this', 'is', 'some', 'text', 'aaaa', 'special', 'char', 'char']) self.assertEqual( t.get_bow(), { 'this': 1, 'is': 1, 'some': 1, 'text': 1, 'aaaa': 1, 'special': 1, 'char': 2 })