async def ingest(
        self, data: str | bytes, **kwargs
    ) -> AsyncGenerator[str, None]:
        """Ingest DOC data and yield text from the document."""
        if isinstance(data, str):
            raise ValueError("DOC data must be in bytes format.")

        # Create BytesIO object from the data
        file_obj = BytesIO(data)

        try:
            # Open the DOC file using olefile
            ole = self.olefile.OleFileIO(file_obj)

            # Check if it's a Word document
            if not ole.exists("WordDocument"):
                raise ValueError("Not a valid Word document")

            # Read the WordDocument stream
            word_stream = ole.openstream("WordDocument").read()

            # Read the text from the 0Table or 1Table stream (contains the text)
            if ole.exists("1Table"):
                table_stream = ole.openstream("1Table").read()
            elif ole.exists("0Table"):
                table_stream = ole.openstream("0Table").read()
            else:
                table_stream = b""

            # Extract text content
            text = self._extract_text(word_stream, table_stream)

            # Clean and split the text
            paragraphs = self._clean_text(text)

            # Yield non-empty paragraphs
            for paragraph in paragraphs:
                if paragraph.strip():
                    yield paragraph.strip()

        except Exception as e:
            raise ValueError(f"Error processing DOC file: {str(e)}") from e
        finally:
            ole.close()
            file_obj.close()
Ingest DOC data and yield text from the document.
py/core/parsers/media/doc_parser.py