コード例 #1
0
 def get_words_num(self):
     my_map = self.script_map
     ret = {}
     for col in my_map:
         x = col['person']
         count = len(Data.get_token(col['text']))
         ret[x] = count if x not in ret.keys() else ret[x] + count
     return ret
コード例 #2
0
 def get_tokens(self):
     ret = []
     for col in self.script_map:
         ret += Data.get_token(col['text'])  # col['text'].lower().split()
     return ret
コード例 #3
0
 def get_char_tokens(self, person):
     ret = []
     for col in self.script_map:
         if col['person'].upper() == person.upper():
             ret += Data.get_token(col['text'])
     return ret