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
def get_tokens(self): ret = [] for col in self.script_map: ret += Data.get_token(col['text']) # col['text'].lower().split() return ret
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