BabelDOC 0.5.15__tar.gz → 0.5.16__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.5.15 → babeldoc-0.5.16}/PKG-INFO +1 -1
- babeldoc-0.5.16/babeldoc/__init__.py +1 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/const.py +1 -1
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout6.py +15 -15
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py +1 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/high_level.py +16 -20
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/translation_config.py +1 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/main.py +1 -1
- babeldoc-0.5.16/babeldoc/utils/memory.py +251 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/pyproject.toml +2 -2
- babeldoc-0.5.15/babeldoc/__init__.py +0 -1
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.cursorignore +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/dependabot.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/labels.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/release-drafter.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/codeql.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/docs.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/labeler.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/lint.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/pr-lint.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/publish-to-pypi.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.github/workflows/test.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.gitignore +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/LICENSE +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/README.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/babeldoc_exception/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/base_doclayout.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/doclayout.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout2.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout3.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout4.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout5.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/rpc_doclayout7.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/babelpdf/base14.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/babelpdf/cidfont.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/babelpdf/encoding.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/babelpdf/utils.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/babelpdf/win_core.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/converter.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/backend/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/backend/pdf_creater.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/frontend/il_creater.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/il_version_1.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/il_version_1.rng +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/add_debug_information.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/typesetting.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/extract_char.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/formular_helper.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/layout_helper.py +1 -1
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/matrix_helper.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/mupdf_helper.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/paragraph_helper.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/spatial_analyzer.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/zstd_helper.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/xml_converter.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/pdfinterp.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/result_merger.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/split_manager.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/glossary.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/LICENSE +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/_saslprep.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/arcfour.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/ascii85.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/casting.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/ccitt.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/78ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/83pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/83pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/90ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/90ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/90msp-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/90msp-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/90pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/90pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Add-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Add-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Add-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Add-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/B5pc-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/B5pc-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/CNS-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/CNS-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/CNS1-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/CNS1-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/CNS2-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/CNS2-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/ETHK-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/ETHK-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/ETen-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/ETen-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/ETenms-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/ETenms-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Ext-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Ext-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Ext-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Ext-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GB-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GB-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GB-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GB-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBK-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBK-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBK2K-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBK2K-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBKp-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBKp-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBT-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBT-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBT-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBT-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBTpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBTpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/GBpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKdla-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKdla-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKdlb-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKdlb-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKgccs-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKgccs-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKm314-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKm314-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKm471-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKm471-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKscs-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/HKscs-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Hankaku-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Hankaku-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Hiragana-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Hiragana-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSC-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSC-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSC-Johab-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSC-Johab-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSCms-UHC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSCms-UHC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSCpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/KSCpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Katakana-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Katakana-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/NWP-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/NWP-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/README.txt +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Roman-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/Roman-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniCNS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniGB-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/UniKS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/WP-Symbol-H.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/WP-Symbol-V.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/to-unicode-Adobe-CNS1.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/to-unicode-Adobe-GB1.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Japan1.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Korea1.pickle.gz +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/cmapdb.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/converter.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/data_structures.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/encodingdb.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/fontmetrics.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/glyphlist.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/high_level.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/image.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/jbig2.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/latin_enc.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/layout.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/lzw.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfcolor.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfdevice.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfdocument.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfexceptions.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdffont.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfinterp.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfpage.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdfparser.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/pdftypes.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/psexceptions.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/psparser.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/py.typed +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/runlength.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/settings.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/pdfminer/utils.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/tools/italic_assistance.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/tools/italic_recognize_tool.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/translator/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/translator/cache.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/translator/translator.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/utils/__init__.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/utils/atomic_integer.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/CONTRIBUTING.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/README.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/deploy.sh +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/example/demo_glossary.csv +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/index.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/requirements.txt +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/docs/supported_languages.md +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/mkdocs.yml +0 -0
- {babeldoc-0.5.15 → babeldoc-0.5.16}/tests/test_translation_cache_cleanup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.16"
|
|
@@ -58,17 +58,6 @@ def encode_image(image) -> bytes:
|
|
|
58
58
|
return encoded
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
@retry(
|
|
62
|
-
stop=stop_after_attempt(3), # 最多重试 3 次
|
|
63
|
-
wait=wait_exponential(
|
|
64
|
-
multiplier=1, min=1, max=10
|
|
65
|
-
), # 指数退避策略,初始 1 秒,最大 10 秒
|
|
66
|
-
retry=retry_if_exception_type((httpx.HTTPError, Exception)), # 针对哪些异常重试
|
|
67
|
-
before_sleep=lambda retry_state: logger.warning(
|
|
68
|
-
f"Request failed, retrying in {getattr(retry_state.next_action, 'sleep', 'unknown')} seconds... "
|
|
69
|
-
f"(Attempt {retry_state.attempt_number}/3)"
|
|
70
|
-
),
|
|
71
|
-
)
|
|
72
61
|
def clip_num(num: float, min_value: float, max_value: float) -> float:
|
|
73
62
|
"""Clip a number to a specified range."""
|
|
74
63
|
if num < min_value:
|
|
@@ -78,6 +67,17 @@ def clip_num(num: float, min_value: float, max_value: float) -> float:
|
|
|
78
67
|
return num
|
|
79
68
|
|
|
80
69
|
|
|
70
|
+
@retry(
|
|
71
|
+
stop=stop_after_attempt(5), # 最多重试 3 次
|
|
72
|
+
wait=wait_exponential(
|
|
73
|
+
multiplier=1, min=1, max=10
|
|
74
|
+
), # 指数退避策略,初始 1 秒,最大 10 秒
|
|
75
|
+
retry=retry_if_exception_type((httpx.HTTPError, Exception)), # 针对哪些异常重试
|
|
76
|
+
before_sleep=lambda retry_state: logger.warning(
|
|
77
|
+
f"Request failed VLM, retrying in {getattr(retry_state.next_action, 'sleep', 'unknown')} seconds... "
|
|
78
|
+
f"(Attempt {retry_state.attempt_number}/5)"
|
|
79
|
+
),
|
|
80
|
+
)
|
|
81
81
|
def predict_layout(
|
|
82
82
|
image,
|
|
83
83
|
host: str = "http://localhost:8000",
|
|
@@ -186,14 +186,14 @@ def predict_layout(
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
@retry(
|
|
189
|
-
stop=stop_after_attempt(
|
|
189
|
+
stop=stop_after_attempt(5), # 最多重试 3 次
|
|
190
190
|
wait=wait_exponential(
|
|
191
191
|
multiplier=1, min=1, max=10
|
|
192
192
|
), # 指数退避策略,初始 1 秒,最大 10 秒
|
|
193
193
|
retry=retry_if_exception_type((httpx.HTTPError, Exception)), # 针对哪些异常重试
|
|
194
194
|
before_sleep=lambda retry_state: logger.warning(
|
|
195
|
-
f"Request failed, retrying in {getattr(retry_state.next_action, 'sleep', 'unknown')} seconds... "
|
|
196
|
-
f"(Attempt {retry_state.attempt_number}/
|
|
195
|
+
f"Request failed PADDLE, retrying in {getattr(retry_state.next_action, 'sleep', 'unknown')} seconds... "
|
|
196
|
+
f"(Attempt {retry_state.attempt_number}/5)"
|
|
197
197
|
),
|
|
198
198
|
)
|
|
199
199
|
def predict_layout2(
|
|
@@ -599,7 +599,7 @@ class RpcDocLayoutModel(DocLayoutModel):
|
|
|
599
599
|
):
|
|
600
600
|
layout_temp_path = translate_config.get_working_file_path("layout.temp.pdf")
|
|
601
601
|
mupdf_doc.save(layout_temp_path.as_posix())
|
|
602
|
-
with ThreadPoolExecutor(max_workers=
|
|
602
|
+
with ThreadPoolExecutor(max_workers=32) as executor:
|
|
603
603
|
yield from executor.map(
|
|
604
604
|
self.predict_page,
|
|
605
605
|
pages,
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py
RENAMED
|
@@ -131,6 +131,7 @@ class DetectScannedFile:
|
|
|
131
131
|
self.translation_config.shared_context_cross_split_part.auto_enabled_ocr_workaround = True
|
|
132
132
|
self.translation_config.ocr_workaround = True
|
|
133
133
|
self.translation_config.skip_scanned_detection = True
|
|
134
|
+
self.translation_config.disable_rich_text_translate = True
|
|
134
135
|
self.clean_render_order_for_chars(docs)
|
|
135
136
|
self.translation_config.remove_non_formula_lines = False
|
|
136
137
|
else:
|
|
@@ -62,6 +62,7 @@ from babeldoc.pdfminer.pdfinterp import PDFResourceManager
|
|
|
62
62
|
from babeldoc.pdfminer.pdfpage import PDFPage
|
|
63
63
|
from babeldoc.pdfminer.pdfparser import PDFParser
|
|
64
64
|
from babeldoc.progress_monitor import ProgressMonitor
|
|
65
|
+
from babeldoc.utils import memory
|
|
65
66
|
|
|
66
67
|
logger = logging.getLogger(__name__)
|
|
67
68
|
|
|
@@ -455,20 +456,10 @@ class MemoryMonitor:
|
|
|
455
456
|
self.peak_memory_usage = 0
|
|
456
457
|
self.monitor_thread = None
|
|
457
458
|
self.stop_event = None
|
|
458
|
-
|
|
459
|
-
try:
|
|
460
|
-
import psutil
|
|
461
|
-
|
|
462
|
-
self.psutil = psutil
|
|
463
|
-
except ImportError:
|
|
464
|
-
logger.warning("psutil not installed, memory monitoring disabled")
|
|
465
|
-
self.psutil = None
|
|
459
|
+
self.last_pss_check_time = None
|
|
466
460
|
|
|
467
461
|
def __enter__(self):
|
|
468
462
|
"""Start memory monitoring."""
|
|
469
|
-
if not self.psutil:
|
|
470
|
-
return self
|
|
471
|
-
|
|
472
463
|
self.stop_event = threading.Event()
|
|
473
464
|
self.monitor_thread = threading.Thread(
|
|
474
465
|
target=self._monitor_memory_usage, daemon=True
|
|
@@ -479,7 +470,7 @@ class MemoryMonitor:
|
|
|
479
470
|
|
|
480
471
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
481
472
|
"""Stop monitoring and log peak memory usage."""
|
|
482
|
-
if not self.
|
|
473
|
+
if not self.monitor_thread:
|
|
483
474
|
return
|
|
484
475
|
|
|
485
476
|
self.stop_event.set()
|
|
@@ -490,14 +481,15 @@ class MemoryMonitor:
|
|
|
490
481
|
"""Background thread that periodically checks memory usage."""
|
|
491
482
|
while not self.stop_event.is_set():
|
|
492
483
|
try:
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
484
|
+
# Use throttled memory check with 2-second PSS throttle
|
|
485
|
+
total_memory, self.last_pss_check_time = (
|
|
486
|
+
memory.get_memory_usage_with_throttle(
|
|
487
|
+
include_children=True,
|
|
488
|
+
prefer_pss=True,
|
|
489
|
+
last_pss_check_time=self.last_pss_check_time,
|
|
490
|
+
pss_throttle_seconds=2.0,
|
|
491
|
+
)
|
|
492
|
+
)
|
|
501
493
|
|
|
502
494
|
# Convert to MB for better readability
|
|
503
495
|
total_memory_mb = total_memory / (1024 * 1024)
|
|
@@ -508,6 +500,10 @@ class MemoryMonitor:
|
|
|
508
500
|
|
|
509
501
|
time.sleep(self.interval)
|
|
510
502
|
|
|
503
|
+
def get_peek_memory_psutil(self):
|
|
504
|
+
"""Get peak memory usage using psutil (for backwards compatibility)."""
|
|
505
|
+
return memory.get_memory_usage_bytes(include_children=True, prefer_pss=True)
|
|
506
|
+
|
|
511
507
|
|
|
512
508
|
def fix_null_page_content(doc: Document) -> list[int]:
|
|
513
509
|
invalid_page = []
|
|
@@ -227,6 +227,7 @@ class TranslationConfig:
|
|
|
227
227
|
|
|
228
228
|
if self.ocr_workaround:
|
|
229
229
|
self.skip_scanned_detection = True
|
|
230
|
+
self.disable_rich_text_translate = True
|
|
230
231
|
|
|
231
232
|
# for backward compatibility
|
|
232
233
|
if use_side_by_side_dual is False and use_alternating_pages_dual is False:
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import time
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
import psutil
|
|
8
|
+
except ImportError:
|
|
9
|
+
psutil = None
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _parse_pss_from_smaps_rollup(pid: int) -> int | None:
|
|
13
|
+
"""
|
|
14
|
+
Try to read PSS from /proc/<pid>/smaps_rollup.
|
|
15
|
+
Returns PSS in bytes, or None if not available/readable.
|
|
16
|
+
"""
|
|
17
|
+
try:
|
|
18
|
+
smaps_rollup_path = Path(f"/proc/{pid}/smaps_rollup")
|
|
19
|
+
with smaps_rollup_path.open() as f:
|
|
20
|
+
for line in f:
|
|
21
|
+
if line.startswith("Pss:"):
|
|
22
|
+
# Format: "Pss: 1234 kB"
|
|
23
|
+
parts = line.split()
|
|
24
|
+
if len(parts) >= 2:
|
|
25
|
+
pss_kb = int(parts[1])
|
|
26
|
+
return pss_kb * 1024 # Convert to bytes
|
|
27
|
+
return None
|
|
28
|
+
except (FileNotFoundError, PermissionError, ValueError, OSError):
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_pss_from_smaps(pid: int) -> int | None:
|
|
33
|
+
"""
|
|
34
|
+
Try to read PSS from /proc/<pid>/smaps and sum all Pss entries.
|
|
35
|
+
Returns PSS in bytes, or None if not available/readable.
|
|
36
|
+
"""
|
|
37
|
+
try:
|
|
38
|
+
smaps_path = Path(f"/proc/{pid}/smaps")
|
|
39
|
+
total_pss_kb = 0
|
|
40
|
+
with smaps_path.open() as f:
|
|
41
|
+
for line in f:
|
|
42
|
+
if line.startswith("Pss:"):
|
|
43
|
+
# Format: "Pss: 1234 kB"
|
|
44
|
+
parts = line.split()
|
|
45
|
+
if len(parts) >= 2:
|
|
46
|
+
total_pss_kb += int(parts[1])
|
|
47
|
+
if total_pss_kb > 0:
|
|
48
|
+
return total_pss_kb * 1024 # Convert to bytes
|
|
49
|
+
return None
|
|
50
|
+
except (FileNotFoundError, PermissionError, ValueError, OSError):
|
|
51
|
+
return None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _get_pss_linux(pid: int) -> int | None:
|
|
55
|
+
"""
|
|
56
|
+
Try to get PSS on Linux.
|
|
57
|
+
Priority: smaps_rollup -> smaps -> None
|
|
58
|
+
Returns PSS in bytes, or None if not available.
|
|
59
|
+
"""
|
|
60
|
+
# Try smaps_rollup first (lightweight)
|
|
61
|
+
pss = _parse_pss_from_smaps_rollup(pid)
|
|
62
|
+
if pss is not None:
|
|
63
|
+
return pss
|
|
64
|
+
|
|
65
|
+
# Fallback to smaps (heavier)
|
|
66
|
+
pss = _parse_pss_from_smaps(pid)
|
|
67
|
+
if pss is not None:
|
|
68
|
+
return pss
|
|
69
|
+
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _get_rss_psutil(pid: int) -> int | None:
|
|
74
|
+
"""
|
|
75
|
+
Get RSS using psutil for a single process.
|
|
76
|
+
Returns RSS in bytes, or None if psutil unavailable or process not found.
|
|
77
|
+
"""
|
|
78
|
+
if psutil is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
try:
|
|
82
|
+
process = psutil.Process(pid)
|
|
83
|
+
return process.memory_info().rss
|
|
84
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.TimeoutExpired):
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def _get_single_process_memory(
|
|
89
|
+
pid: int, prefer_pss: bool = True, use_smaps_rollup_only: bool = False
|
|
90
|
+
) -> int | None:
|
|
91
|
+
"""
|
|
92
|
+
Get memory usage for a single process (no children).
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
pid: Process ID
|
|
96
|
+
prefer_pss: If True and on Linux, try PSS first; otherwise use RSS
|
|
97
|
+
use_smaps_rollup_only: If True, only try smaps_rollup (faster), fallback to RSS if not available
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Memory usage in bytes, or None if all methods fail
|
|
101
|
+
"""
|
|
102
|
+
if sys.platform == "linux":
|
|
103
|
+
if prefer_pss:
|
|
104
|
+
if use_smaps_rollup_only:
|
|
105
|
+
# Only try smaps_rollup, then fallback to RSS
|
|
106
|
+
pss = _parse_pss_from_smaps_rollup(pid)
|
|
107
|
+
if pss is not None:
|
|
108
|
+
return pss
|
|
109
|
+
else:
|
|
110
|
+
# Try full PSS (smaps_rollup -> smaps)
|
|
111
|
+
pss = _get_pss_linux(pid)
|
|
112
|
+
if pss is not None:
|
|
113
|
+
return pss
|
|
114
|
+
|
|
115
|
+
# Fallback to RSS
|
|
116
|
+
return _get_rss_psutil(pid)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def get_memory_usage_bytes(
|
|
120
|
+
pid: int | None = None,
|
|
121
|
+
include_children: bool = True,
|
|
122
|
+
prefer_pss: bool = True,
|
|
123
|
+
) -> int:
|
|
124
|
+
"""
|
|
125
|
+
Get memory usage of a process (and optionally its children).
|
|
126
|
+
|
|
127
|
+
On Linux with prefer_pss=True:
|
|
128
|
+
- Tries /proc/<pid>/smaps_rollup first (lightweight)
|
|
129
|
+
- Falls back to /proc/<pid>/smaps if smaps_rollup unavailable (heavier)
|
|
130
|
+
- Falls back to psutil RSS if smaps unavailable
|
|
131
|
+
|
|
132
|
+
On non-Linux systems or prefer_pss=False:
|
|
133
|
+
- Uses psutil RSS
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
pid: Process ID to monitor. If None, uses current process.
|
|
137
|
+
include_children: If True, also includes memory of child processes.
|
|
138
|
+
prefer_pss: If True on Linux, attempts to use PSS; otherwise uses RSS.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
Total memory usage in bytes (guaranteed non-negative).
|
|
142
|
+
"""
|
|
143
|
+
if pid is None:
|
|
144
|
+
pid = os.getpid()
|
|
145
|
+
|
|
146
|
+
total_memory = 0
|
|
147
|
+
|
|
148
|
+
# Determine if we're using smaps (heavier) vs smaps_rollup (lighter)
|
|
149
|
+
use_smaps_rollup_only = False
|
|
150
|
+
if sys.platform == "linux" and prefer_pss:
|
|
151
|
+
# If we can read smaps_rollup, use rollup-only mode
|
|
152
|
+
test_rollup = _parse_pss_from_smaps_rollup(pid)
|
|
153
|
+
use_smaps_rollup_only = test_rollup is not None
|
|
154
|
+
|
|
155
|
+
# Get current process memory
|
|
156
|
+
memory = _get_single_process_memory(
|
|
157
|
+
pid, prefer_pss=prefer_pss, use_smaps_rollup_only=use_smaps_rollup_only
|
|
158
|
+
)
|
|
159
|
+
if memory is not None:
|
|
160
|
+
total_memory += memory
|
|
161
|
+
|
|
162
|
+
# Get children memory if requested
|
|
163
|
+
if include_children:
|
|
164
|
+
if psutil is None:
|
|
165
|
+
# Cannot get children without psutil
|
|
166
|
+
return total_memory
|
|
167
|
+
|
|
168
|
+
try:
|
|
169
|
+
parent_process = psutil.Process(pid)
|
|
170
|
+
children = parent_process.children(recursive=True)
|
|
171
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
172
|
+
# Parent process not found or no permission
|
|
173
|
+
return total_memory
|
|
174
|
+
|
|
175
|
+
for child in children:
|
|
176
|
+
try:
|
|
177
|
+
child_pid = child.pid
|
|
178
|
+
child_memory = _get_single_process_memory(
|
|
179
|
+
child_pid,
|
|
180
|
+
prefer_pss=prefer_pss,
|
|
181
|
+
use_smaps_rollup_only=use_smaps_rollup_only,
|
|
182
|
+
)
|
|
183
|
+
if child_memory is not None:
|
|
184
|
+
total_memory += child_memory
|
|
185
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
186
|
+
# Child process died or no permission; skip it
|
|
187
|
+
pass
|
|
188
|
+
|
|
189
|
+
return max(0, total_memory)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def get_memory_usage_with_throttle(
|
|
193
|
+
pid: int | None = None,
|
|
194
|
+
include_children: bool = True,
|
|
195
|
+
prefer_pss: bool = True,
|
|
196
|
+
last_pss_check_time: float | None = None,
|
|
197
|
+
pss_throttle_seconds: float = 2.0,
|
|
198
|
+
) -> tuple[int, float | None]:
|
|
199
|
+
"""
|
|
200
|
+
Get memory usage with throttling for PSS checks on Linux.
|
|
201
|
+
|
|
202
|
+
When PSS is not available via smaps_rollup and must read smaps (expensive),
|
|
203
|
+
this throttles checks to at most once per pss_throttle_seconds.
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
pid: Process ID. If None, uses current process.
|
|
207
|
+
include_children: If True, includes child process memory.
|
|
208
|
+
prefer_pss: If True on Linux, attempts to use PSS.
|
|
209
|
+
last_pss_check_time: Timestamp of last PSS check. For throttling logic.
|
|
210
|
+
pss_throttle_seconds: Minimum interval (seconds) between smaps reads.
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
Tuple of (memory_bytes, new_check_time).
|
|
214
|
+
If throttled, returns cached estimate (0) and original check time.
|
|
215
|
+
"""
|
|
216
|
+
current_time = time.time()
|
|
217
|
+
|
|
218
|
+
# Check if we should throttle
|
|
219
|
+
if (
|
|
220
|
+
prefer_pss
|
|
221
|
+
and sys.platform == "linux"
|
|
222
|
+
and last_pss_check_time is not None
|
|
223
|
+
and (current_time - last_pss_check_time) < pss_throttle_seconds
|
|
224
|
+
):
|
|
225
|
+
# Throttled: use RSS only as a fast estimate
|
|
226
|
+
memory = 0
|
|
227
|
+
pid_to_check = pid if pid is not None else os.getpid()
|
|
228
|
+
rss = _get_rss_psutil(pid_to_check)
|
|
229
|
+
if rss is not None:
|
|
230
|
+
memory += rss
|
|
231
|
+
|
|
232
|
+
if include_children and psutil is not None:
|
|
233
|
+
try:
|
|
234
|
+
parent_process = psutil.Process(pid_to_check)
|
|
235
|
+
for child in parent_process.children(recursive=True):
|
|
236
|
+
try:
|
|
237
|
+
child_rss = _get_rss_psutil(child.pid)
|
|
238
|
+
if child_rss is not None:
|
|
239
|
+
memory += child_rss
|
|
240
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
241
|
+
pass
|
|
242
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
243
|
+
pass
|
|
244
|
+
|
|
245
|
+
return memory, last_pss_check_time
|
|
246
|
+
|
|
247
|
+
# Not throttled: do full check
|
|
248
|
+
memory = get_memory_usage_bytes(
|
|
249
|
+
pid=pid, include_children=include_children, prefer_pss=prefer_pss
|
|
250
|
+
)
|
|
251
|
+
return memory, current_time
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.16"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -162,7 +162,7 @@ pythonpath = [".", "src"]
|
|
|
162
162
|
testpaths = ["tests"]
|
|
163
163
|
|
|
164
164
|
[bumpver]
|
|
165
|
-
current_version = "0.5.
|
|
165
|
+
current_version = "0.5.16"
|
|
166
166
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
167
167
|
|
|
168
168
|
[bumpver.file_patterns]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.5.15"
|
|
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
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/add_debug_information.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py
RENAMED
|
File without changes
|
|
File without changes
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py
RENAMED
|
File without changes
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/midend/remove_descent.py
RENAMED
|
File without changes
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/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
|
{babeldoc-0.5.15 → babeldoc-0.5.16}/babeldoc/format/pdf/document_il/utils/formular_helper.py
RENAMED
|
File without changes
|
|
@@ -659,7 +659,6 @@ def get_character_layout(
|
|
|
659
659
|
layout_priority = [
|
|
660
660
|
"number",
|
|
661
661
|
"reference",
|
|
662
|
-
"reference_hybrid",
|
|
663
662
|
"reference_content",
|
|
664
663
|
"algorithm",
|
|
665
664
|
"formula_caption",
|
|
@@ -703,6 +702,7 @@ def get_character_layout(
|
|
|
703
702
|
"page_header",
|
|
704
703
|
"page_footer",
|
|
705
704
|
# --- hybrid labels ---
|
|
705
|
+
"reference_hybrid",
|
|
706
706
|
"document_hybrid",
|
|
707
707
|
"academic_paper_hybrid",
|
|
708
708
|
"form_or_table_hybrid",
|
|
File without changes
|
|
File without changes
|