| 75 | return '' |
| 76 | |
| 77 | class JSONLReader(Reader): |
| 78 | def parse_file(file_path: Path) -> list: |
| 79 | logger.info(f"Reading JSON Lines file from {file_path}.") |
| 80 | with open(file_path, "r",encoding='utf-8') as f: |
| 81 | lines = [json.loads(line) for line in f] |
| 82 | |
| 83 | return lines |
| 84 | |
| 85 | def parse(file_path: Path) -> str: |
| 86 | logger.info(f"Reading JSON Lines file from {file_path}.") |
| 87 | with open(file_path, "r",encoding='utf-8') as f: |
| 88 | lines = [json.loads(line) for line in f] |
| 89 | text = '\n'.join([str(line) for line in lines]) |
| 90 | return text |
| 91 | |
| 92 | class XMLReader(Reader): |
| 93 | def parse(self, file_path: Path) -> str: |