mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-09-24 16:29:01 +08:00
- Added a new `.env.lite.example` file for the Lite version, providing a minimal configuration template. - Updated `.env.example` to remove deprecated variables and include new Docreader settings. - Enhanced Docker configurations to support the Lite version, including a new Dockerfile for the Docreader service. - Introduced a Makefile target for building and running the Lite version, along with packaging capabilities. - Created GitHub workflows for building and releasing Lite binaries, including Homebrew formula support. - Implemented a new service file for managing the Lite version as a system service. This update enables a streamlined, single-binary deployment of WeKnora, reducing external dependencies and simplifying setup.
16 lines
576 B
Python
16 lines
576 B
Python
from docreader.parser.chain_parser import FirstParser
|
|
from docreader.parser.markitdown_parser import MarkitdownParser
|
|
|
|
|
|
class PDFParser(FirstParser):
|
|
"""PDF Parser using chain of responsibility pattern
|
|
|
|
Attempts to parse PDF files using multiple parser backends in order:
|
|
1. MinerUParser - Primary parser for PDF documents
|
|
2. MarkitdownParser - Fallback parser if MinerU fails
|
|
|
|
The first successful parser result will be returned.
|
|
"""
|
|
# Parser classes to try in order (chain of responsibility pattern)
|
|
_parser_cls = (MarkitdownParser,)
|