BabelDOC 0.4.8__tar.gz → 0.4.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {babeldoc-0.4.8 → babeldoc-0.4.10}/PKG-INFO +2 -1
- {babeldoc-0.4.8 → babeldoc-0.4.10}/README.md +1 -0
- babeldoc-0.4.10/babeldoc/__init__.py +1 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/const.py +1 -1
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/backend/pdf_creater.py +19 -1
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/typesetting.py +60 -2
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/result_merger.py +17 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/translation_config.py +24 -5
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/main.py +8 -1
- {babeldoc-0.4.8 → babeldoc-0.4.10}/pyproject.toml +2 -2
- {babeldoc-0.4.8 → babeldoc-0.4.10}/uv.lock +1 -1
- babeldoc-0.4.8/babeldoc/__init__.py +0 -1
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.cursorignore +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/dependabot.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/labels.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/release-drafter.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/codeql.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/docs.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/labeler.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/lint.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/pr-lint.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/publish-to-pypi.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.github/workflows/test.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.gitignore +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/LICENSE +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/babeldoc_exception/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/base_doclayout.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/doclayout.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/rpc_doclayout2.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/converter.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/backend/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/frontend/il_creater.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/il_version_1.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/il_version_1.rng +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/add_debug_information.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/formular_helper.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/layout_helper.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/mupdf_helper.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/paragraph_helper.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/zstd_helper.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/xml_converter.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/high_level.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/pdfinterp.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/split_manager.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/glossary.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/LICENSE +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/_saslprep.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/arcfour.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/ascii85.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/casting.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/ccitt.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/78ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/83pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/83pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/90ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/90ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/90msp-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/90msp-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/90pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/90pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Add-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Add-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Add-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Add-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/B5pc-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/B5pc-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/CNS-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/CNS-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/CNS1-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/CNS1-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/CNS2-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/CNS2-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/ETHK-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/ETHK-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/ETen-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/ETen-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/ETenms-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/ETenms-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Ext-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Ext-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Ext-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Ext-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GB-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GB-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GB-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GB-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBK-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBK-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBK2K-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBK2K-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBKp-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBKp-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBT-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBT-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBT-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBT-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBTpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBTpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/GBpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKdla-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKdla-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKdlb-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKdlb-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKgccs-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKgccs-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKm314-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKm314-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKm471-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKm471-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKscs-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/HKscs-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Hankaku-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Hankaku-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Hiragana-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Hiragana-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSC-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSC-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSC-Johab-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSC-Johab-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSCms-UHC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSCms-UHC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSCpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/KSCpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Katakana-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Katakana-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/NWP-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/NWP-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/README.txt +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Roman-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/Roman-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniCNS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniGB-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/UniKS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/WP-Symbol-H.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/WP-Symbol-V.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/to-unicode-Adobe-CNS1.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/to-unicode-Adobe-GB1.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Japan1.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Korea1.pickle.gz +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/cmapdb.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/converter.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/data_structures.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/encodingdb.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/fontmetrics.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/glyphlist.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/high_level.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/image.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/jbig2.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/latin_enc.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/layout.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/lzw.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfcolor.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfdevice.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfdocument.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfexceptions.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdffont.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfinterp.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfpage.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdfparser.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/pdftypes.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/psexceptions.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/psparser.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/py.typed +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/runlength.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/settings.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/pdfminer/utils.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/tools/italic_assistance.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/tools/italic_recognize_tool.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/translator/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/translator/cache.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/translator/translator.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/utils/__init__.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/utils/atomic_integer.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/CONTRIBUTING.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/README.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/deploy.sh +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/example/demo_glossary.csv +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/index.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/requirements.txt +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/docs/supported_languages.md +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/mkdocs.yml +0 -0
- {babeldoc-0.4.8 → babeldoc-0.4.10}/tests/test_translation_config.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: BabelDOC
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.10
|
|
4
4
|
Summary: Yet Another Document Translator
|
|
5
5
|
Project-URL: Homepage, https://github.com/funstory-ai/BabelDOC
|
|
6
6
|
Project-URL: Issues, https://github.com/funstory-ai/BabelDOC/issues
|
|
@@ -219,6 +219,7 @@ uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model
|
|
|
219
219
|
- `--rpc-doclayout`: RPC service host address for document layout analysis (default: None)
|
|
220
220
|
- `--working-dir`: Working directory for translation. If not set, use temp directory.
|
|
221
221
|
- `--no-auto-extract-glossary`: Disable automatic term extraction. If this flag is present, the step is skipped. Defaults to enabled.
|
|
222
|
+
- `--save-auto-extracted-glossary`: Save automatically extracted glossary to the specified file. If not set, the glossary will not be saved.
|
|
222
223
|
|
|
223
224
|
> [!TIP]
|
|
224
225
|
> - Both `--skip-clean` and `--dual-translate-first` may help improve compatibility with some PDF readers
|
|
@@ -166,6 +166,7 @@ uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model
|
|
|
166
166
|
- `--rpc-doclayout`: RPC service host address for document layout analysis (default: None)
|
|
167
167
|
- `--working-dir`: Working directory for translation. If not set, use temp directory.
|
|
168
168
|
- `--no-auto-extract-glossary`: Disable automatic term extraction. If this flag is present, the step is skipped. Defaults to enabled.
|
|
169
|
+
- `--save-auto-extracted-glossary`: Save automatically extracted glossary to the specified file. If not set, the glossary will not be saved.
|
|
169
170
|
|
|
170
171
|
> [!TIP]
|
|
171
172
|
> - Both `--skip-clean` and `--dual-translate-first` may help improve compatibility with some PDF readers
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.10"
|
|
@@ -1081,7 +1081,25 @@ class PDFCreater:
|
|
|
1081
1081
|
mono_out_path = None
|
|
1082
1082
|
if self.translation_config.no_dual:
|
|
1083
1083
|
dual_out_path = None
|
|
1084
|
-
|
|
1084
|
+
auto_extracted_glossary_path = None
|
|
1085
|
+
if (
|
|
1086
|
+
self.translation_config.save_auto_extracted_glossary
|
|
1087
|
+
and self.translation_config.shared_context_cross_split_part.auto_extracted_glossary
|
|
1088
|
+
):
|
|
1089
|
+
auto_extracted_glossary_path = self.translation_config.get_output_file_path(
|
|
1090
|
+
f"{basename}{debug_suffix}.{translation_config.lang_out}.glossary.csv"
|
|
1091
|
+
)
|
|
1092
|
+
with auto_extracted_glossary_path.open("w", encoding="utf-8") as f:
|
|
1093
|
+
logger.info(
|
|
1094
|
+
f"save auto extracted glossary to {auto_extracted_glossary_path}"
|
|
1095
|
+
)
|
|
1096
|
+
f.write(
|
|
1097
|
+
self.translation_config.shared_context_cross_split_part.auto_extracted_glossary.to_csv()
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
return TranslateResult(
|
|
1101
|
+
mono_out_path, dual_out_path, auto_extracted_glossary_path
|
|
1102
|
+
)
|
|
1085
1103
|
except Exception:
|
|
1086
1104
|
logger.exception(
|
|
1087
1105
|
"Failed to create PDF: %s",
|
|
@@ -6,6 +6,7 @@ import unicodedata
|
|
|
6
6
|
from functools import cache
|
|
7
7
|
|
|
8
8
|
import pymupdf
|
|
9
|
+
from rtree import index
|
|
9
10
|
|
|
10
11
|
from babeldoc.const import WATERMARK_VERSION
|
|
11
12
|
from babeldoc.format.pdf.document_il import Box
|
|
@@ -16,6 +17,7 @@ from babeldoc.format.pdf.document_il import PdfStyle
|
|
|
16
17
|
from babeldoc.format.pdf.document_il import il_version_1
|
|
17
18
|
from babeldoc.format.pdf.document_il.utils.fontmap import FontMapper
|
|
18
19
|
from babeldoc.format.pdf.document_il.utils.formular_helper import update_formula_data
|
|
20
|
+
from babeldoc.format.pdf.document_il.utils.layout_helper import box_to_tuple
|
|
19
21
|
from babeldoc.format.pdf.translation_config import TranslationConfig
|
|
20
22
|
from babeldoc.format.pdf.translation_config import WatermarkOutputMode
|
|
21
23
|
|
|
@@ -592,6 +594,62 @@ class Typesetting:
|
|
|
592
594
|
== WatermarkOutputMode.Watermarked
|
|
593
595
|
):
|
|
594
596
|
self.add_watermark(page)
|
|
597
|
+
try:
|
|
598
|
+
para_index = index.Index()
|
|
599
|
+
para_map = {}
|
|
600
|
+
#
|
|
601
|
+
valid_paras = [
|
|
602
|
+
p
|
|
603
|
+
for p in page.pdf_paragraph
|
|
604
|
+
if p.box
|
|
605
|
+
and all(c is not None for c in [p.box.x, p.box.y, p.box.x2, p.box.y2])
|
|
606
|
+
]
|
|
607
|
+
|
|
608
|
+
for i, para in enumerate(valid_paras):
|
|
609
|
+
para_map[i] = para
|
|
610
|
+
para_index.insert(i, box_to_tuple(para.box))
|
|
611
|
+
|
|
612
|
+
for i, p_upper in para_map.items():
|
|
613
|
+
required_gap = 6
|
|
614
|
+
if not (p_upper.box and p_upper.box.y is not None):
|
|
615
|
+
continue
|
|
616
|
+
|
|
617
|
+
check_area = il_version_1.Box(
|
|
618
|
+
x=p_upper.box.x,
|
|
619
|
+
y=p_upper.box.y - required_gap,
|
|
620
|
+
x2=p_upper.box.x2,
|
|
621
|
+
y2=p_upper.box.y,
|
|
622
|
+
)
|
|
623
|
+
|
|
624
|
+
candidate_ids = list(para_index.intersection(box_to_tuple(check_area)))
|
|
625
|
+
|
|
626
|
+
conflicting_paras = []
|
|
627
|
+
for para_id in candidate_ids:
|
|
628
|
+
if para_id == i:
|
|
629
|
+
continue
|
|
630
|
+
p_lower = para_map[para_id]
|
|
631
|
+
if not (
|
|
632
|
+
p_lower.box
|
|
633
|
+
and p_upper.box
|
|
634
|
+
and p_lower.box.x2 < p_upper.box.x
|
|
635
|
+
or p_lower.box.x > p_upper.box.x2
|
|
636
|
+
):
|
|
637
|
+
conflicting_paras.append(p_lower)
|
|
638
|
+
|
|
639
|
+
if conflicting_paras:
|
|
640
|
+
max_y2 = max(
|
|
641
|
+
p.box.y2
|
|
642
|
+
for p in conflicting_paras
|
|
643
|
+
if p.box and p.box.y2 is not None
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
new_y = max_y2 + required_gap
|
|
647
|
+
if p_upper.box and new_y < p_upper.box.y2:
|
|
648
|
+
p_upper.box.y = new_y
|
|
649
|
+
except Exception as e:
|
|
650
|
+
logger.warning(
|
|
651
|
+
f"Failed to adjust paragraph positions on page {page.page_number}: {e}"
|
|
652
|
+
)
|
|
595
653
|
# 开始实际的渲染过程
|
|
596
654
|
for paragraph in page.pdf_paragraph:
|
|
597
655
|
self.render_paragraph(paragraph, page, fonts)
|
|
@@ -887,7 +945,7 @@ class Typesetting:
|
|
|
887
945
|
if scale < 0.7 and min_line_spacing > 1.1:
|
|
888
946
|
if expand_space_flag == 0:
|
|
889
947
|
# 先尝试向下扩展
|
|
890
|
-
min_y = self.get_max_bottom_space(box, page)
|
|
948
|
+
min_y = self.get_max_bottom_space(box, page) + 2
|
|
891
949
|
if min_y < box.y:
|
|
892
950
|
expanded_box = Box(
|
|
893
951
|
x=box.x,
|
|
@@ -902,7 +960,7 @@ class Typesetting:
|
|
|
902
960
|
continue
|
|
903
961
|
elif expand_space_flag == 1:
|
|
904
962
|
# 如果向下扩展后还不够,再尝试向右扩展
|
|
905
|
-
max_x = self.get_max_right_space(box, page)
|
|
963
|
+
max_x = self.get_max_right_space(box, page) - 5
|
|
906
964
|
if max_x > box.x2:
|
|
907
965
|
expanded_box = Box(
|
|
908
966
|
x=box.x,
|
|
@@ -127,10 +127,27 @@ class ResultMerger:
|
|
|
127
127
|
logger.error(f"Error merging no-watermark PDFs: {e}")
|
|
128
128
|
merged_no_watermark_dual_path = None
|
|
129
129
|
|
|
130
|
+
auto_extracted_glossary_path = None
|
|
131
|
+
if (
|
|
132
|
+
self.config.save_auto_extracted_glossary
|
|
133
|
+
and self.config.shared_context_cross_split_part.auto_extracted_glossary
|
|
134
|
+
):
|
|
135
|
+
auto_extracted_glossary_path = self.config.get_output_file_path(
|
|
136
|
+
f"{basename}{debug_suffix}.{self.config.lang_out}.glossary.csv"
|
|
137
|
+
)
|
|
138
|
+
with auto_extracted_glossary_path.open("w", encoding="utf-8") as f:
|
|
139
|
+
logger.info(
|
|
140
|
+
f"save auto extracted glossary to {auto_extracted_glossary_path}"
|
|
141
|
+
)
|
|
142
|
+
f.write(
|
|
143
|
+
self.config.shared_context_cross_split_part.auto_extracted_glossary.to_csv()
|
|
144
|
+
)
|
|
145
|
+
|
|
130
146
|
# Create merged result
|
|
131
147
|
merged_result = TranslateResult(
|
|
132
148
|
mono_pdf_path=merged_mono_path,
|
|
133
149
|
dual_pdf_path=merged_dual_path,
|
|
150
|
+
auto_extracted_glossary_path=auto_extracted_glossary_path,
|
|
134
151
|
)
|
|
135
152
|
merged_result.no_watermark_mono_pdf_path = merged_no_watermark_mono_path
|
|
136
153
|
merged_result.no_watermark_dual_pdf_path = merged_no_watermark_dual_path
|
|
@@ -154,6 +154,7 @@ class TranslationConfig:
|
|
|
154
154
|
auto_enable_ocr_workaround: bool = False,
|
|
155
155
|
primary_font_family: str | None = None,
|
|
156
156
|
only_include_translated_page: bool | None = False,
|
|
157
|
+
save_auto_extracted_glossary: bool = True,
|
|
157
158
|
):
|
|
158
159
|
self.translator = translator
|
|
159
160
|
initial_user_glossaries = list(glossaries) if glossaries else []
|
|
@@ -274,6 +275,8 @@ class TranslationConfig:
|
|
|
274
275
|
|
|
275
276
|
self.only_include_translated_page = only_include_translated_page
|
|
276
277
|
|
|
278
|
+
self.save_auto_extracted_glossary = save_auto_extracted_glossary
|
|
279
|
+
|
|
277
280
|
def parse_pages(self, pages_str: str | None) -> list[tuple[int, int]] | None:
|
|
278
281
|
"""解析页码字符串,返回页码范围列表
|
|
279
282
|
|
|
@@ -380,13 +383,19 @@ class TranslationConfig:
|
|
|
380
383
|
class TranslateResult:
|
|
381
384
|
original_pdf_path: str
|
|
382
385
|
total_seconds: float
|
|
383
|
-
mono_pdf_path:
|
|
384
|
-
dual_pdf_path:
|
|
385
|
-
no_watermark_mono_pdf_path:
|
|
386
|
-
no_watermark_dual_pdf_path:
|
|
386
|
+
mono_pdf_path: Path | None
|
|
387
|
+
dual_pdf_path: Path | None
|
|
388
|
+
no_watermark_mono_pdf_path: Path | None
|
|
389
|
+
no_watermark_dual_pdf_path: Path | None
|
|
387
390
|
peak_memory_usage: int | None
|
|
391
|
+
auto_extracted_glossary_path: Path | None
|
|
388
392
|
|
|
389
|
-
def __init__(
|
|
393
|
+
def __init__(
|
|
394
|
+
self,
|
|
395
|
+
mono_pdf_path: Path | None,
|
|
396
|
+
dual_pdf_path: Path | None,
|
|
397
|
+
auto_extracted_glossary_path: Path | None = None,
|
|
398
|
+
):
|
|
390
399
|
self.mono_pdf_path = mono_pdf_path
|
|
391
400
|
self.dual_pdf_path = dual_pdf_path
|
|
392
401
|
|
|
@@ -395,6 +404,8 @@ class TranslateResult:
|
|
|
395
404
|
self.no_watermark_mono_pdf_path = mono_pdf_path
|
|
396
405
|
self.no_watermark_dual_pdf_path = dual_pdf_path
|
|
397
406
|
|
|
407
|
+
self.auto_extracted_glossary_path = auto_extracted_glossary_path
|
|
408
|
+
|
|
398
409
|
def __str__(self):
|
|
399
410
|
"""Return a human-readable string representation of the translation result."""
|
|
400
411
|
result = []
|
|
@@ -428,6 +439,14 @@ class TranslateResult:
|
|
|
428
439
|
f"\tNo-watermark Dual-language PDF: {self.no_watermark_dual_pdf_path}"
|
|
429
440
|
)
|
|
430
441
|
|
|
442
|
+
if (
|
|
443
|
+
hasattr(self, "auto_extracted_glossary_path")
|
|
444
|
+
and self.auto_extracted_glossary_path
|
|
445
|
+
):
|
|
446
|
+
result.append(
|
|
447
|
+
f"\tAuto-extracted glossary: {self.auto_extracted_glossary_path}"
|
|
448
|
+
)
|
|
449
|
+
|
|
431
450
|
if hasattr(self, "peak_memory_usage") and self.peak_memory_usage:
|
|
432
451
|
result.append(f"\tPeak memory usage: {self.peak_memory_usage} MB")
|
|
433
452
|
|
|
@@ -21,7 +21,7 @@ from babeldoc.translator.translator import OpenAITranslator
|
|
|
21
21
|
from babeldoc.translator.translator import set_translate_rate_limiter
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
24
|
-
__version__ = "0.4.
|
|
24
|
+
__version__ = "0.4.10"
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def create_parser():
|
|
@@ -271,6 +271,12 @@ def create_parser():
|
|
|
271
271
|
default=False,
|
|
272
272
|
help="Only include translated pages in the output PDF. Effective only when --pages is used.",
|
|
273
273
|
)
|
|
274
|
+
translation_group.add_argument(
|
|
275
|
+
"--save-auto-extracted-glossary",
|
|
276
|
+
action="store_true",
|
|
277
|
+
default=False,
|
|
278
|
+
help="Save automatically extracted glossary terms to a CSV file in the output directory.",
|
|
279
|
+
)
|
|
274
280
|
# service option argument group
|
|
275
281
|
service_group = translation_group.add_mutually_exclusive_group()
|
|
276
282
|
service_group.add_argument(
|
|
@@ -498,6 +504,7 @@ async def main():
|
|
|
498
504
|
auto_enable_ocr_workaround=args.auto_enable_ocr_workaround,
|
|
499
505
|
primary_font_family=args.primary_font_family,
|
|
500
506
|
only_include_translated_page=args.only_include_translated_page,
|
|
507
|
+
save_auto_extracted_glossary=args.save_auto_extracted_glossary,
|
|
501
508
|
)
|
|
502
509
|
|
|
503
510
|
# Create progress handler
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.10"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -158,7 +158,7 @@ pythonpath = [".", "src"]
|
|
|
158
158
|
testpaths = ["tests"]
|
|
159
159
|
|
|
160
160
|
[bumpver]
|
|
161
|
-
current_version = "0.4.
|
|
161
|
+
current_version = "0.4.10"
|
|
162
162
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
163
163
|
|
|
164
164
|
[bumpver.file_patterns]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/add_debug_information.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.8 → babeldoc-0.4.10}/babeldoc/format/pdf/document_il/utils/paragraph_helper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|