def _extract_text(self, word_stream: bytes, table_stream: bytes) -> str:
        """Extract text from Word document streams."""
        try:
            text = word_stream.replace(b"\x00", b"").decode(
                "utf-8", errors="ignore"
            )

            # If table_stream exists, try to extract additional text
            if table_stream:
                table_text = table_stream.replace(b"\x00", b"").decode(
                    "utf-8", errors="ignore"
                )
                text += table_text

            return text
        except Exception as e:
            raise ValueError(f"Error extracting text: {str(e)}") from e
Extract text from Word document streams.
py/core/parsers/media/doc_parser.py