(self, s)
| 77 | return os.path.join(lazypath, data_type + '.len.pkl') |
| 78 | |
| 79 | def write(self, s): |
| 80 | if isinstance(s, dict): |
| 81 | s = s['text'] |
| 82 | if self.is_array: |
| 83 | encoded = np.array(s, dtype=self.array_data_type).tobytes(order='C') |
| 84 | self.output.write(encoded) |
| 85 | self.lengths.append(len(s)) |
| 86 | else: |
| 87 | encoded = s.encode('utf-8') |
| 88 | self.output.write(encoded) |
| 89 | self.lengths.append(len(encoded)) |
| 90 | |
| 91 | def close(self): |
| 92 | self.output.close() |
no test coverage detected