| 45 | return text |
| 46 | |
| 47 | class DOCXReader(Reader): |
| 48 | def parse(self, file_path: Path) -> str: |
| 49 | logger.info(f"Reading DOCX file from {file_path}.") |
| 50 | content = docx.Document(str(file_path)) |
| 51 | text = "" |
| 52 | for i, para in enumerate(content.paragraphs): |
| 53 | text += f'Page {i + 1}:\n' + para.text |
| 54 | return text |
| 55 | |
| 56 | class JSONReader(Reader): |
| 57 | def parse_file(file_path: Path) -> list: |