def reader(self): with open(self.filepath, 'r') as f: if self.has_header: next(f) for line in f: w, *vec = line.split() yield w, vec