BabelDOC 0.4.2__tar.gz → 0.4.4__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.2 → babeldoc-0.4.4}/PKG-INFO +1 -1
- babeldoc-0.4.4/babeldoc/__init__.py +1 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/const.py +1 -1
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/rpc_doclayout2.py +1 -1
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/backend/pdf_creater.py +1 -1
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/frontend/il_creater.py +1 -1
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/add_debug_information.py +3 -4
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py +87 -41
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/typesetting.py +8 -7
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/layout_helper.py +2 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/main.py +1 -1
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdffont.py +7 -89
- {babeldoc-0.4.2 → babeldoc-0.4.4}/pyproject.toml +2 -2
- {babeldoc-0.4.2 → babeldoc-0.4.4}/uv.lock +2 -1
- babeldoc-0.4.2/babeldoc/__init__.py +0 -1
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.cursorignore +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/dependabot.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/labels.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/release-drafter.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/codeql.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/docs.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/labeler.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/lint.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/pr-lint.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/publish-to-pypi.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.github/workflows/test.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.gitignore +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/LICENSE +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/README.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/babeldoc_exception/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/base_doclayout.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/doclayout.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/converter.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/backend/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/il_version_1.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/il_version_1.rng +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/formular_helper.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/mupdf_helper.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/paragraph_helper.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/utils/zstd_helper.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/xml_converter.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/high_level.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/pdfinterp.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/result_merger.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/split_manager.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/translation_config.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/glossary.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/LICENSE +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/_saslprep.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/arcfour.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/ascii85.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/casting.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/ccitt.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/78ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/83pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/83pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/90ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/90ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/90msp-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/90msp-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/90pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/90pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Add-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Add-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Add-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Add-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/B5pc-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/B5pc-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/CNS-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/CNS-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/CNS1-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/CNS1-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/CNS2-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/CNS2-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/ETHK-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/ETHK-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/ETen-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/ETen-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/ETenms-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/ETenms-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Ext-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Ext-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Ext-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Ext-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GB-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GB-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GB-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GB-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBK-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBK-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBK2K-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBK2K-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBKp-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBKp-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBT-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBT-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBT-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBT-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBTpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBTpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/GBpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKdla-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKdla-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKdlb-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKdlb-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKgccs-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKgccs-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKm314-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKm314-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKm471-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKm471-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKscs-B5-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/HKscs-B5-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Hankaku-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Hankaku-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Hiragana-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Hiragana-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSC-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSC-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSC-Johab-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSC-Johab-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSCms-UHC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSCms-UHC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSCpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/KSCpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Katakana-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Katakana-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/NWP-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/NWP-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/README.txt +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Roman-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/Roman-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniCNS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniGB-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/UniKS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/WP-Symbol-H.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/WP-Symbol-V.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/to-unicode-Adobe-CNS1.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/to-unicode-Adobe-GB1.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Japan1.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Korea1.pickle.gz +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/cmapdb.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/converter.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/data_structures.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/encodingdb.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/fontmetrics.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/glyphlist.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/high_level.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/image.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/jbig2.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/latin_enc.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/layout.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/lzw.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfcolor.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfdevice.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfdocument.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfexceptions.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfinterp.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfpage.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdfparser.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/pdftypes.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/psexceptions.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/psparser.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/py.typed +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/runlength.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/settings.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/pdfminer/utils.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/tools/italic_assistance.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/tools/italic_recognize_tool.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/translator/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/translator/cache.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/translator/translator.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/utils/__init__.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/utils/atomic_integer.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/CONTRIBUTING.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/README.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/deploy.sh +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/example/demo_glossary.csv +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/index.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/requirements.txt +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/docs/supported_languages.md +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/mkdocs.yml +0 -0
- {babeldoc-0.4.2 → babeldoc-0.4.4}/tests/test_translation_config.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.4"
|
|
@@ -286,7 +286,7 @@ class RpcDocLayoutModel(DocLayoutModel):
|
|
|
286
286
|
translate_config,
|
|
287
287
|
save_debug_image,
|
|
288
288
|
):
|
|
289
|
-
with ThreadPoolExecutor(max_workers=
|
|
289
|
+
with ThreadPoolExecutor(max_workers=128) as executor:
|
|
290
290
|
yield from executor.map(
|
|
291
291
|
self.predict_page,
|
|
292
292
|
pages,
|
|
@@ -656,7 +656,7 @@ class ILCreater:
|
|
|
656
656
|
_, encoding = self.mupdf.xref_get_key(xref_id, "Encoding")
|
|
657
657
|
if encoding == "/Identity-H" or encoding == "/Identity-V":
|
|
658
658
|
encoding_length = 2
|
|
659
|
-
|
|
659
|
+
elif encoding == "/WinAnsiEncoding":
|
|
660
660
|
encoding_length = 1
|
|
661
661
|
else:
|
|
662
662
|
_, to_unicode_id = self.mupdf.xref_get_key(xref_id, "ToUnicode")
|
{babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/add_debug_information.py
RENAMED
|
@@ -3,7 +3,6 @@ import logging
|
|
|
3
3
|
import babeldoc.format.pdf.document_il.il_version_1 as il_version_1
|
|
4
4
|
from babeldoc.format.pdf.document_il import GraphicState
|
|
5
5
|
from babeldoc.format.pdf.document_il.utils.style_helper import BLUE
|
|
6
|
-
from babeldoc.format.pdf.document_il.utils.style_helper import CYAN
|
|
7
6
|
from babeldoc.format.pdf.document_il.utils.style_helper import ORANGE
|
|
8
7
|
from babeldoc.format.pdf.document_il.utils.style_helper import TEAL
|
|
9
8
|
from babeldoc.format.pdf.document_il.utils.style_helper import YELLOW
|
|
@@ -133,9 +132,9 @@ class AddDebugInformation:
|
|
|
133
132
|
char.visual_bbox.box, TEAL, line_width=0.2
|
|
134
133
|
),
|
|
135
134
|
)
|
|
136
|
-
page.pdf_rectangle.append(
|
|
137
|
-
|
|
138
|
-
)
|
|
135
|
+
# page.pdf_rectangle.append(
|
|
136
|
+
# self._create_rectangle(char.box, CYAN, line_width=0.2),
|
|
137
|
+
# )
|
|
139
138
|
|
|
140
139
|
for xobj in page.pdf_xobject:
|
|
141
140
|
new_paragraphs.append(
|
{babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py
RENAMED
|
@@ -23,6 +23,7 @@ from babeldoc.format.pdf.document_il.utils.formular_helper import update_formula
|
|
|
23
23
|
from babeldoc.format.pdf.document_il.utils.layout_helper import LEFT_BRACKET
|
|
24
24
|
from babeldoc.format.pdf.document_il.utils.layout_helper import RIGHT_BRACKET
|
|
25
25
|
from babeldoc.format.pdf.document_il.utils.layout_helper import build_layout_index
|
|
26
|
+
from babeldoc.format.pdf.document_il.utils.layout_helper import calculate_iou_for_boxes
|
|
26
27
|
from babeldoc.format.pdf.document_il.utils.layout_helper import (
|
|
27
28
|
calculate_y_iou_for_boxes,
|
|
28
29
|
)
|
|
@@ -66,6 +67,7 @@ class StylesAndFormulas:
|
|
|
66
67
|
self.merge_overlapping_formulas(page)
|
|
67
68
|
# self.process_page_offsets(page)
|
|
68
69
|
self.process_translatable_formulas(page)
|
|
70
|
+
self.update_all_formula_data(page)
|
|
69
71
|
self.process_page_offsets(page)
|
|
70
72
|
self.update_all_formula_data(page)
|
|
71
73
|
self.process_page_styles(page)
|
|
@@ -476,6 +478,8 @@ class StylesAndFormulas:
|
|
|
476
478
|
return
|
|
477
479
|
|
|
478
480
|
for paragraph in page.pdf_paragraph:
|
|
481
|
+
if paragraph.debug_id is None:
|
|
482
|
+
continue
|
|
479
483
|
if not paragraph.pdf_paragraph_composition:
|
|
480
484
|
continue
|
|
481
485
|
|
|
@@ -499,22 +503,28 @@ class StylesAndFormulas:
|
|
|
499
503
|
comp = paragraph.pdf_paragraph_composition[j]
|
|
500
504
|
if comp.pdf_line:
|
|
501
505
|
for char in reversed(comp.pdf_line.pdf_character):
|
|
506
|
+
if not char.pdf_character_id:
|
|
507
|
+
continue
|
|
502
508
|
# 检查 y 坐标是否接近,判断是否在同一行
|
|
503
509
|
left_iou = calculate_y_iou_for_boxes(char.box, formula.box)
|
|
504
510
|
if left_iou > 0.6:
|
|
505
511
|
left_char = char
|
|
506
512
|
break
|
|
513
|
+
break
|
|
507
514
|
|
|
508
515
|
# 查找右边最近的同一行的文本
|
|
509
516
|
for j in range(i + 1, len(paragraph.pdf_paragraph_composition)):
|
|
510
517
|
comp = paragraph.pdf_paragraph_composition[j]
|
|
511
518
|
if comp.pdf_line:
|
|
512
519
|
for char in comp.pdf_line.pdf_character:
|
|
520
|
+
if not char.pdf_character_id:
|
|
521
|
+
continue
|
|
513
522
|
# 检查 y 坐标是否接近,判断是否在同一行
|
|
514
523
|
right_iou = calculate_y_iou_for_boxes(char.box, formula.box)
|
|
515
524
|
if right_iou > 0.6:
|
|
516
525
|
right_char = char
|
|
517
526
|
break
|
|
527
|
+
break
|
|
518
528
|
|
|
519
529
|
# If both text segments exist, keep the one with higher IOU
|
|
520
530
|
if left_char and right_char:
|
|
@@ -600,6 +610,9 @@ class StylesAndFormulas:
|
|
|
600
610
|
|
|
601
611
|
def is_translatable_formula(self, formula: PdfFormula) -> bool:
|
|
602
612
|
"""判断公式是否只包含需要正常翻译的字符(数字、空格和英文逗号)"""
|
|
613
|
+
if all(char.formula_layout_id for char in formula.pdf_character):
|
|
614
|
+
return False
|
|
615
|
+
|
|
603
616
|
text = "".join(char.char_unicode for char in formula.pdf_character)
|
|
604
617
|
if formula.y_offset > 0.1:
|
|
605
618
|
return False
|
|
@@ -710,8 +723,11 @@ class StylesAndFormulas:
|
|
|
710
723
|
|
|
711
724
|
def merge_overlapping_formulas(self, page: Page):
|
|
712
725
|
"""
|
|
713
|
-
|
|
714
|
-
|
|
726
|
+
合并符合以下条件的公式:
|
|
727
|
+
1. x 轴重叠且 y 轴有交集的相邻公式,或者
|
|
728
|
+
2. x 轴相邻且 y 轴 IOU > 0.5 的相邻公式,或者
|
|
729
|
+
3. 所有字符的 layout id 都相同的相邻公式,或者
|
|
730
|
+
4. 任意两个公式的 IOU > 0.8
|
|
715
731
|
角标可能会被识别成单独的公式,需要合并
|
|
716
732
|
"""
|
|
717
733
|
if not page.pdf_paragraph:
|
|
@@ -721,46 +737,76 @@ class StylesAndFormulas:
|
|
|
721
737
|
if not paragraph.pdf_paragraph_composition:
|
|
722
738
|
continue
|
|
723
739
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
740
|
+
# 重复执行合并过程,直到没有更多可以合并的公式
|
|
741
|
+
merged = True
|
|
742
|
+
while merged:
|
|
743
|
+
merged = False
|
|
744
|
+
for i in range(len(paragraph.pdf_paragraph_composition)):
|
|
745
|
+
if merged:
|
|
746
|
+
break
|
|
747
|
+
comp1 = paragraph.pdf_paragraph_composition[i]
|
|
748
|
+
if comp1.pdf_formula is None:
|
|
749
|
+
continue
|
|
750
|
+
|
|
751
|
+
for j in range(i + 1, len(paragraph.pdf_paragraph_composition)):
|
|
752
|
+
comp2 = paragraph.pdf_paragraph_composition[j]
|
|
753
|
+
if comp2.pdf_formula is None:
|
|
754
|
+
continue
|
|
755
|
+
|
|
756
|
+
formula1 = comp1.pdf_formula
|
|
757
|
+
formula2 = comp2.pdf_formula
|
|
758
|
+
|
|
759
|
+
# 检查合并条件:
|
|
760
|
+
# 1. x 轴重叠且 y 轴有交集,或者
|
|
761
|
+
# 2. x 轴相邻且 y 轴 IOU > 0.5,或者
|
|
762
|
+
# 3. 所有字符的 layout id 都相同,或者
|
|
763
|
+
# 4. 任意两个公式的 IOU > 0.8
|
|
764
|
+
should_merge = (
|
|
765
|
+
(
|
|
766
|
+
j == i + 1
|
|
767
|
+
and (
|
|
768
|
+
(
|
|
769
|
+
self.is_x_axis_contained(
|
|
770
|
+
formula1.box, formula2.box
|
|
771
|
+
)
|
|
772
|
+
and self.has_y_intersection(
|
|
773
|
+
formula1.box, formula2.box
|
|
774
|
+
)
|
|
775
|
+
)
|
|
776
|
+
or (
|
|
777
|
+
self.is_x_axis_adjacent(
|
|
778
|
+
formula1.box, formula2.box
|
|
779
|
+
)
|
|
780
|
+
and self.calculate_y_iou(
|
|
781
|
+
formula1.box, formula2.box
|
|
782
|
+
)
|
|
783
|
+
> 0.5
|
|
784
|
+
)
|
|
785
|
+
)
|
|
786
|
+
)
|
|
787
|
+
or (self._have_same_layout_ids(formula1, formula2, page))
|
|
788
|
+
or (
|
|
789
|
+
calculate_iou_for_boxes(formula1.box, formula2.box)
|
|
790
|
+
> 0.8
|
|
791
|
+
)
|
|
792
|
+
or (
|
|
793
|
+
calculate_iou_for_boxes(formula2.box, formula1.box)
|
|
794
|
+
> 0.8
|
|
795
|
+
)
|
|
796
|
+
)
|
|
752
797
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
798
|
+
if should_merge:
|
|
799
|
+
# 合并公式
|
|
800
|
+
merged_formula = self.merge_formulas(formula1, formula2)
|
|
801
|
+
paragraph.pdf_paragraph_composition[i] = (
|
|
802
|
+
PdfParagraphComposition(
|
|
803
|
+
pdf_formula=merged_formula,
|
|
804
|
+
)
|
|
805
|
+
)
|
|
806
|
+
# 删除第二个公式
|
|
807
|
+
del paragraph.pdf_paragraph_composition[j]
|
|
808
|
+
merged = True
|
|
809
|
+
break
|
|
764
810
|
|
|
765
811
|
def _have_same_layout_ids(
|
|
766
812
|
self, formula1: PdfFormula, formula2: PdfFormula, page: Page
|
|
@@ -350,11 +350,12 @@ class TypesettingUnit:
|
|
|
350
350
|
|
|
351
351
|
return box
|
|
352
352
|
elif self.formular:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
formular_box
|
|
357
|
-
|
|
353
|
+
return self.formular.box
|
|
354
|
+
# if self.formular.x_offset <= 0.5:
|
|
355
|
+
# return self.formular.box
|
|
356
|
+
# formular_box = copy.copy(self.formular.box)
|
|
357
|
+
# formular_box.x2 += self.formular.x_advance
|
|
358
|
+
# return formular_box
|
|
358
359
|
elif self.unicode:
|
|
359
360
|
char_width = self.font.char_lengths(self.unicode, self.font_size)[0]
|
|
360
361
|
if self.x is None or self.y is None or self.scale is None:
|
|
@@ -407,8 +408,8 @@ class TypesettingUnit:
|
|
|
407
408
|
elif self.formular:
|
|
408
409
|
# 创建新的公式对象,保持内部字符的相对位置
|
|
409
410
|
new_chars = []
|
|
410
|
-
min_x =
|
|
411
|
-
min_y =
|
|
411
|
+
min_x = self.formular.box.x
|
|
412
|
+
min_y = self.formular.box.y
|
|
412
413
|
|
|
413
414
|
for char in self.formular.pdf_character:
|
|
414
415
|
# 计算相对位置
|
|
@@ -634,6 +634,7 @@ def get_character_layout(
|
|
|
634
634
|
"abstract",
|
|
635
635
|
"content",
|
|
636
636
|
"figure_title",
|
|
637
|
+
"chart_title",
|
|
637
638
|
"table_title",
|
|
638
639
|
"doc_title",
|
|
639
640
|
"footnote",
|
|
@@ -722,6 +723,7 @@ def is_text_layout(layout: Layout):
|
|
|
722
723
|
"footer",
|
|
723
724
|
"seal",
|
|
724
725
|
"text",
|
|
726
|
+
"chart_title",
|
|
725
727
|
]
|
|
726
728
|
|
|
727
729
|
|
|
@@ -8,6 +8,7 @@ from typing import TYPE_CHECKING
|
|
|
8
8
|
from typing import Any
|
|
9
9
|
from typing import BinaryIO
|
|
10
10
|
from typing import cast
|
|
11
|
+
import freetype
|
|
11
12
|
|
|
12
13
|
from babeldoc.pdfminer.casting import safe_float
|
|
13
14
|
from babeldoc.pdfminer.casting import safe_rect_list
|
|
@@ -749,99 +750,16 @@ class TrueTypeFont:
|
|
|
749
750
|
def create_unicode_map(self) -> FileUnicodeMap:
|
|
750
751
|
if b"cmap" not in self.tables:
|
|
751
752
|
raise TrueTypeFont.CMapNotFound
|
|
752
|
-
(base_offset, length) = self.tables[b"cmap"]
|
|
753
753
|
fp = self.fp
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
cast(tuple[int, int, int], struct.unpack(">HHL", fp.read(8))),
|
|
760
|
-
)
|
|
761
|
-
char2gid: dict[int, int] = {}
|
|
762
|
-
# Only supports subtable type 0, 2 and 4.
|
|
763
|
-
for platform_id, encoding_id, st_offset in subtables:
|
|
764
|
-
# Skip non-Unicode cmaps.
|
|
765
|
-
# https://docs.microsoft.com/en-us/typography/opentype/spec/cmap
|
|
766
|
-
if not (platform_id == 0 or (platform_id == 3 and encoding_id in [1, 10])):
|
|
767
|
-
continue
|
|
768
|
-
fp.seek(base_offset + st_offset)
|
|
769
|
-
(fmttype, fmtlen, fmtlang) = cast(
|
|
770
|
-
tuple[int, int, int],
|
|
771
|
-
struct.unpack(">HHH", fp.read(6)),
|
|
772
|
-
)
|
|
773
|
-
if fmttype == 0:
|
|
774
|
-
char2gid.update(
|
|
775
|
-
enumerate(
|
|
776
|
-
cast(tuple[int, ...], struct.unpack(">256B", fp.read(256))),
|
|
777
|
-
),
|
|
778
|
-
)
|
|
779
|
-
elif fmttype == 2:
|
|
780
|
-
subheaderkeys = cast(
|
|
781
|
-
tuple[int, ...],
|
|
782
|
-
struct.unpack(">256H", fp.read(512)),
|
|
783
|
-
)
|
|
784
|
-
firstbytes = [0] * 8192
|
|
785
|
-
for i, k in enumerate(subheaderkeys):
|
|
786
|
-
firstbytes[k // 8] = i
|
|
787
|
-
nhdrs = max(subheaderkeys) // 8 + 1
|
|
788
|
-
hdrs: list[tuple[int, int, int, int, int]] = []
|
|
789
|
-
for i in range(nhdrs):
|
|
790
|
-
(firstcode, entcount, delta, offset) = cast(
|
|
791
|
-
tuple[int, int, int, int],
|
|
792
|
-
struct.unpack(">HHhH", fp.read(8)),
|
|
793
|
-
)
|
|
794
|
-
hdrs.append((i, firstcode, entcount, delta, fp.tell() - 2 + offset))
|
|
795
|
-
for i, firstcode, entcount, delta, pos in hdrs:
|
|
796
|
-
if not entcount:
|
|
797
|
-
continue
|
|
798
|
-
first = firstcode + (firstbytes[i] << 8)
|
|
799
|
-
fp.seek(pos)
|
|
800
|
-
for c in range(entcount):
|
|
801
|
-
gid = cast(tuple[int], struct.unpack(">H", fp.read(2)))[0]
|
|
802
|
-
if gid:
|
|
803
|
-
gid += delta
|
|
804
|
-
char2gid[first + c] = gid
|
|
805
|
-
elif fmttype == 4:
|
|
806
|
-
(segcount, _1, _2, _3) = cast(
|
|
807
|
-
tuple[int, int, int, int],
|
|
808
|
-
struct.unpack(">HHHH", fp.read(8)),
|
|
809
|
-
)
|
|
810
|
-
segcount //= 2
|
|
811
|
-
ecs = cast(
|
|
812
|
-
tuple[int, ...],
|
|
813
|
-
struct.unpack(">%dH" % segcount, fp.read(2 * segcount)),
|
|
814
|
-
)
|
|
815
|
-
fp.read(2)
|
|
816
|
-
scs = cast(
|
|
817
|
-
tuple[int, ...],
|
|
818
|
-
struct.unpack(">%dH" % segcount, fp.read(2 * segcount)),
|
|
819
|
-
)
|
|
820
|
-
idds = cast(
|
|
821
|
-
tuple[int, ...],
|
|
822
|
-
struct.unpack(">%dh" % segcount, fp.read(2 * segcount)),
|
|
823
|
-
)
|
|
824
|
-
pos = fp.tell()
|
|
825
|
-
idrs = cast(
|
|
826
|
-
tuple[int, ...],
|
|
827
|
-
struct.unpack(">%dH" % segcount, fp.read(2 * segcount)),
|
|
828
|
-
)
|
|
829
|
-
for ec, sc, idd, idr in zip(ecs, scs, idds, idrs, strict=False):
|
|
830
|
-
if idr:
|
|
831
|
-
fp.seek(pos + idr)
|
|
832
|
-
for c in range(sc, ec + 1):
|
|
833
|
-
b = cast(tuple[int], struct.unpack(">H", fp.read(2)))[0]
|
|
834
|
-
char2gid[c] = (b + idd) & 0xFFFF
|
|
835
|
-
else:
|
|
836
|
-
for c in range(sc, ec + 1):
|
|
837
|
-
char2gid[c] = (c + idd) & 0xFFFF
|
|
838
|
-
else:
|
|
839
|
-
assert False, str(("Unhandled", fmttype))
|
|
840
|
-
if not char2gid:
|
|
754
|
+
char2gid = []
|
|
755
|
+
try:
|
|
756
|
+
face = freetype.Face(fp)
|
|
757
|
+
char2gid = list(face.get_chars())
|
|
758
|
+
except Exception:
|
|
841
759
|
raise TrueTypeFont.CMapNotFound
|
|
842
760
|
# create unicode map
|
|
843
761
|
unicode_map = FileUnicodeMap()
|
|
844
|
-
for char, gid in char2gid
|
|
762
|
+
for char, gid in char2gid:
|
|
845
763
|
unicode_map.add_cid2unichr(gid, char)
|
|
846
764
|
return unicode_map
|
|
847
765
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.4"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -157,7 +157,7 @@ pythonpath = [".", "src"]
|
|
|
157
157
|
testpaths = ["tests"]
|
|
158
158
|
|
|
159
159
|
[bumpver]
|
|
160
|
-
current_version = "0.4.
|
|
160
|
+
current_version = "0.4.4"
|
|
161
161
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
162
162
|
|
|
163
163
|
[bumpver.file_patterns]
|
|
@@ -48,7 +48,7 @@ wheels = [
|
|
|
48
48
|
|
|
49
49
|
[[package]]
|
|
50
50
|
name = "babeldoc"
|
|
51
|
-
version = "0.4.
|
|
51
|
+
version = "0.4.4"
|
|
52
52
|
source = { editable = "." }
|
|
53
53
|
dependencies = [
|
|
54
54
|
{ name = "bitstring" },
|
|
@@ -2333,6 +2333,7 @@ sdist = { url = "https://files.pythonhosted.org/packages/bd/62/d29612ca33b7844e7
|
|
|
2333
2333
|
wheels = [
|
|
2334
2334
|
{ url = "https://files.pythonhosted.org/packages/32/5a/3399a2caf51c91db650de57464465b830c2d4ea15b23d24a98182202b704/pymupdf-1.26.1-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:32296f12a7c7f36febd59cee77823a54490313bcaba9879b17def6518186f94e", size = 23054640, upload-time = "2025-06-11T22:14:07.439Z" },
|
|
2335
2335
|
{ url = "https://files.pythonhosted.org/packages/64/e0/cc3ec6a4d5ada8992b8610f134565ceb517243f12736b50d795cb3459315/pymupdf-1.26.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:aad7949eca62aca40854510cdb125cf873b181726dc9497a90834200f31faa63", size = 22402766, upload-time = "2025-06-11T22:14:25.557Z" },
|
|
2336
|
+
{ url = "https://files.pythonhosted.org/packages/e8/cf/d5b1cd775a17a7b83e25cbf4c46f64cf1352c962ca97646e3e01953cf0df/pymupdf-1.26.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3b62c4d443121ed9a2eb967c3a0e45f8dbabcc838db8604ece02c4e868808edc", size = 23448474, upload-time = "2025-06-20T17:51:56.446Z" },
|
|
2336
2337
|
{ url = "https://files.pythonhosted.org/packages/82/9f/e7101bd24a0f5cbfa0310c8e5c3a8ec0dd9a86986812ff86ac2fbd273c92/pymupdf-1.26.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a65c411eb1cbb79e40c307e10fbad23658f19e9d7334ac4de21d24b58009a7b9", size = 24056183, upload-time = "2025-06-11T22:14:53.777Z" },
|
|
2337
2338
|
{ url = "https://files.pythonhosted.org/packages/99/39/23ac15cf0edc2877ef366dc7ae041ac199d212433c2c3113661d1a1d5ad0/pymupdf-1.26.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:26cebdcc1b2b7a7445423599ce2e0000f2be0333cce0fa0e6846e5a7da46f965", size = 24258802, upload-time = "2025-06-11T22:15:20.499Z" },
|
|
2338
2339
|
{ url = "https://files.pythonhosted.org/packages/e1/8c/56bd5951128d5c5c0b64d2942090c2cd7bc44302bac991b941ac736e3d63/pymupdf-1.26.1-cp39-abi3-win32.whl", hash = "sha256:82ed9e106cf564fc959c0691c374ba68443086ba1a1c9f26128eebbc3e6df9e5", size = 16927933, upload-time = "2025-06-11T22:15:59.72Z" },
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.2"
|
|
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.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py
RENAMED
|
File without changes
|
{babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.4.2 → babeldoc-0.4.4}/babeldoc/format/pdf/document_il/midend/paragraph_finder.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
|