BabelDOC 0.5.22__tar.gz → 0.5.24__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.22 → babeldoc-0.5.24}/.github/ISSUE_TEMPLATE/bug_report.yaml +9 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/codeql.yml +1 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/docs.yml +2 -2
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/labeler.yml +2 -2
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/lint.yml +1 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/pr-lint.yml +3 -3
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/publish-to-pypi.yml +3 -3
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/workflows/test.yml +2 -2
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.gitignore +1 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/PKG-INFO +4 -2
- {babeldoc-0.5.22 → babeldoc-0.5.24}/README.md +2 -0
- babeldoc-0.5.24/babeldoc/__init__.py +1 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/const.py +1 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/doclayout.py +45 -9
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/babelpdf/cidfont.py +6 -2
- babeldoc-0.5.24/babeldoc/format/pdf/babelpdf/type3.py +41 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/backend/pdf_creater.py +8 -5
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/frontend/il_creater.py +6 -8
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/automatic_term_extractor.py +1 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py +18 -10
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/result_merger.py +1 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/translation_config.py +2 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/main.py +8 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/translator/translator.py +8 -2
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/CONTRIBUTING.md +6 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/mkdocs.yml +1 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/pyproject.toml +3 -3
- babeldoc-0.5.22/.cursorignore +0 -2
- babeldoc-0.5.22/babeldoc/__init__.py +0 -1
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/dependabot.yml +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/labels.yml +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.github/release-drafter.yml +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/LICENSE +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/babeldoc_exception/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/base_doclayout.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout2.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout3.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout4.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout5.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout6.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/rpc_doclayout7.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/babelpdf/base14.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/babelpdf/cmap.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/babelpdf/encoding.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/babelpdf/utils.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/babelpdf/win_core.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/converter.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/backend/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/il_version_1.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/il_version_1.rng +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/add_debug_information.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/detect_scanned_file.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/styles_and_formulas.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/typesetting.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/extract_char.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/formular_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/layout_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/matrix_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/mupdf_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/paragraph_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/spatial_analyzer.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/utils/zstd_helper.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/xml_converter.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/high_level.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/pdfinterp.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/split_manager.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/glossary.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/LICENSE +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/_saslprep.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/arcfour.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/ascii85.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/casting.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/ccitt.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/78ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/83pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/83pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/90ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/90ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/90msp-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/90msp-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/90pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/90pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Add-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Add-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Add-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Add-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/B5pc-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/B5pc-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/CNS-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/CNS-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/CNS1-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/CNS1-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/CNS2-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/CNS2-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/ETHK-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/ETHK-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/ETen-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/ETen-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/ETenms-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/ETenms-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Ext-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Ext-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Ext-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Ext-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GB-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GB-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GB-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GB-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBK-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBK-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBK2K-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBK2K-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBKp-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBKp-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBT-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBT-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBT-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBT-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBTpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBTpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/GBpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKdla-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKdla-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKdlb-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKdlb-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKgccs-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKgccs-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKm314-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKm314-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKm471-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKm471-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKscs-B5-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/HKscs-B5-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Hankaku-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Hankaku-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Hiragana-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Hiragana-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSC-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSC-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSC-Johab-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSC-Johab-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSCms-UHC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSCms-UHC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSCpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/KSCpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Katakana-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Katakana-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/NWP-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/NWP-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/README.txt +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Roman-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/Roman-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniCNS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniGB-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/UniKS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/WP-Symbol-H.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/WP-Symbol-V.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/to-unicode-Adobe-CNS1.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/to-unicode-Adobe-GB1.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Japan1.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Korea1.pickle.gz +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/cmapdb.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/converter.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/data_structures.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/encodingdb.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/fontmetrics.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/glyphlist.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/high_level.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/image.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/jbig2.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/latin_enc.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/layout.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/lzw.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfcolor.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfdevice.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfdocument.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfexceptions.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdffont.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfinterp.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfpage.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdfparser.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/pdftypes.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/psexceptions.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/psparser.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/py.typed +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/runlength.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/settings.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/pdfminer/utils.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/tools/generate_cmap_metadata.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/tools/italic_assistance.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/tools/italic_recognize_tool.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/translator/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/translator/cache.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/utils/__init__.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/utils/atomic_integer.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/utils/memory.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/README.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/deploy.sh +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/example/demo_glossary.csv +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/index.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/requirements.txt +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/docs/supported_languages.md +0 -0
- {babeldoc-0.5.22 → babeldoc-0.5.24}/tests/test_translation_cache_cleanup.py +0 -0
|
@@ -23,6 +23,8 @@ body:
|
|
|
23
23
|
required: true
|
|
24
24
|
- label: I confirm that the latest version of BabelDOC is being used.
|
|
25
25
|
required: true
|
|
26
|
+
- label: I am aware that the issue section of this project is only for submitting bugs that are clearly related to the BabelDOC core, with complete reproduction steps and relevant logs attached.** Otherwise, issues will be closed directly.
|
|
27
|
+
required: true
|
|
26
28
|
|
|
27
29
|
- type: markdown
|
|
28
30
|
attributes:
|
|
@@ -33,6 +35,12 @@ body:
|
|
|
33
35
|
Please also note:
|
|
34
36
|
- If you are using a downstream project like pdf2zh-next, please submit an issue directly to the downstream application. Only when you confirm that this issue is a problem with the core library of BabelDOC, submit this issue.
|
|
35
37
|
- The CLI is only used for debugging purposes, we do not provide any technical support for CLI usage.
|
|
38
|
+
|
|
39
|
+
- type: markdown
|
|
40
|
+
attributes:
|
|
41
|
+
value: |
|
|
42
|
+
Please note! Users of immersive translate online services should contact customer service and provide their translation ID. **Feedback related to online services is not handled here.**
|
|
43
|
+
|
|
36
44
|
- type: textarea
|
|
37
45
|
id: environment
|
|
38
46
|
attributes:
|
|
@@ -58,7 +66,7 @@ body:
|
|
|
58
66
|
id: reproduce
|
|
59
67
|
attributes:
|
|
60
68
|
label: Steps to Reproduce
|
|
61
|
-
description: Help us reproduce the issue
|
|
69
|
+
description: Help us reproduce the issue. Issues that do not provide reproduction steps will be closed directly.
|
|
62
70
|
value: |
|
|
63
71
|
1. Go to '...'
|
|
64
72
|
2. Click on '...'
|
|
@@ -55,7 +55,7 @@ jobs:
|
|
|
55
55
|
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
56
56
|
steps:
|
|
57
57
|
- name: Checkout repository
|
|
58
|
-
uses: actions/checkout@
|
|
58
|
+
uses: actions/checkout@v6
|
|
59
59
|
|
|
60
60
|
# Initializes the CodeQL tools for scanning.
|
|
61
61
|
- name: Initialize CodeQL
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
deploy:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
13
|
with:
|
|
14
14
|
fetch-depth: 0
|
|
15
15
|
- name: Configure Git Credentials
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
cache-dependency-glob: "uv.lock"
|
|
25
25
|
activate-environment: true
|
|
26
26
|
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
|
27
|
-
- uses: actions/cache@
|
|
27
|
+
- uses: actions/cache@v5
|
|
28
28
|
with:
|
|
29
29
|
key: mkdocs-material-${{ env.cache_id }}
|
|
30
30
|
path: .cache
|
|
@@ -22,10 +22,10 @@ jobs:
|
|
|
22
22
|
runs-on: ubuntu-latest
|
|
23
23
|
steps:
|
|
24
24
|
- name: Check out the repository
|
|
25
|
-
uses: actions/checkout@
|
|
25
|
+
uses: actions/checkout@v6
|
|
26
26
|
|
|
27
27
|
- name: Run Labeler
|
|
28
|
-
uses: crazy-max/ghaction-github-labeler@
|
|
28
|
+
uses: crazy-max/ghaction-github-labeler@548a7c3603594ec17c819e1239f281a3b801ab4d # v6.0.0
|
|
29
29
|
with:
|
|
30
30
|
skip-delete: true
|
|
31
31
|
dry-run: ${{ github.event_name == 'pull_request' }}
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
name: runner / ruff
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
13
|
|
|
14
14
|
- name: Install Python
|
|
15
15
|
uses: actions/setup-python@v6
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
run: pip install ruff
|
|
21
21
|
|
|
22
22
|
- name: Install reviewdog
|
|
23
|
-
uses: reviewdog/action-setup@
|
|
23
|
+
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
|
|
24
24
|
with:
|
|
25
25
|
reviewdog_version: latest
|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ jobs:
|
|
|
34
34
|
name: runner / autocorrect
|
|
35
35
|
runs-on: ubuntu-latest
|
|
36
36
|
steps:
|
|
37
|
-
- uses: actions/checkout@
|
|
37
|
+
- uses: actions/checkout@v6
|
|
38
38
|
- name: AutoCorrect
|
|
39
39
|
uses: huacnlee/autocorrect-action@bf91ab3904c2908dd8e71312a8a83ed1eb632997 # v2.13.3
|
|
40
40
|
- name: Report ReviewDog
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
outputs:
|
|
29
29
|
is_release: ${{ steps.check-version.outputs.tag }}
|
|
30
30
|
steps:
|
|
31
|
-
- uses: actions/checkout@
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
32
|
with:
|
|
33
33
|
persist-credentials: true
|
|
34
34
|
fetch-depth: 2
|
|
@@ -69,7 +69,7 @@ jobs:
|
|
|
69
69
|
run: "uv build"
|
|
70
70
|
|
|
71
71
|
- name: Store the distribution packages
|
|
72
|
-
uses: actions/upload-artifact@
|
|
72
|
+
uses: actions/upload-artifact@v7.0.0
|
|
73
73
|
with:
|
|
74
74
|
name: python-package-distributions
|
|
75
75
|
path: dist/
|
|
@@ -139,7 +139,7 @@ jobs:
|
|
|
139
139
|
contents: write
|
|
140
140
|
pull-requests: write
|
|
141
141
|
steps:
|
|
142
|
-
- uses: actions/checkout@
|
|
142
|
+
- uses: actions/checkout@v6
|
|
143
143
|
with:
|
|
144
144
|
persist-credentials: true
|
|
145
145
|
fetch-depth: 2
|
|
@@ -18,12 +18,12 @@ jobs:
|
|
|
18
18
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
19
19
|
|
|
20
20
|
steps:
|
|
21
|
-
- uses: actions/checkout@
|
|
21
|
+
- uses: actions/checkout@v6
|
|
22
22
|
with:
|
|
23
23
|
persist-credentials: false
|
|
24
24
|
- name: Cached Assets
|
|
25
25
|
id: cache-assets
|
|
26
|
-
uses: actions/cache@
|
|
26
|
+
uses: actions/cache@v5
|
|
27
27
|
with:
|
|
28
28
|
path: ~/.cache/babeldoc
|
|
29
29
|
key: babeldoc-assets-${{ hashFiles('babeldoc/assets/embedding_assets_metadata.py') }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: BabelDOC
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.24
|
|
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
|
|
@@ -21,6 +21,7 @@ Requires-Dist: freetype-py>=2.5.1
|
|
|
21
21
|
Requires-Dist: httpx[socks]>=0.27.0
|
|
22
22
|
Requires-Dist: huggingface-hub>=0.27.0
|
|
23
23
|
Requires-Dist: hyperscan>=0.7.13
|
|
24
|
+
Requires-Dist: levenshtein>=0.27.1
|
|
24
25
|
Requires-Dist: msgpack>=1.1.0
|
|
25
26
|
Requires-Dist: numpy>=2.0.2
|
|
26
27
|
Requires-Dist: onnx>=1.18.0
|
|
@@ -32,7 +33,6 @@ Requires-Dist: peewee>=3.17.8
|
|
|
32
33
|
Requires-Dist: psutil>=7.0.0
|
|
33
34
|
Requires-Dist: pydantic>=2.10.6
|
|
34
35
|
Requires-Dist: pymupdf>=1.25.1
|
|
35
|
-
Requires-Dist: python-levenshtein>=0.27.1
|
|
36
36
|
Requires-Dist: pyzstd>=0.17.0
|
|
37
37
|
Requires-Dist: rapidocr-onnxruntime>=1.4.4
|
|
38
38
|
Requires-Dist: rich>=13.9.4
|
|
@@ -251,6 +251,7 @@ uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model
|
|
|
251
251
|
- `--openai`: Use OpenAI for translation (default: False)
|
|
252
252
|
- `--custom-system-prompt`: Custom system prompt for translation.
|
|
253
253
|
- `--add-formula-placehold-hint`: Add formula placeholder hint for translation. (Currently not recommended, it may affect translation quality, default: False)
|
|
254
|
+
- `--disable-same-text-fallback`: Disable fallback translation when LLM output matches input text. (default: False)
|
|
254
255
|
- `--pool-max-workers`: Maximum number of worker threads for internal task processing pools. If not specified, defaults to QPS value. This parameter directly sets the worker count, replacing previous QPS-based dynamic calculations.
|
|
255
256
|
- `--no-auto-extract-glossary`: Disable automatic term extraction. If this flag is present, the step is skipped. Defaults to enabled.
|
|
256
257
|
|
|
@@ -361,6 +362,7 @@ openai-model = "gpt-4o-mini"
|
|
|
361
362
|
openai-base-url = "https://api.openai.com/v1"
|
|
362
363
|
openai-api-key = "your-api-key-here"
|
|
363
364
|
enable-json-mode-if-requested = false # Enable JSON mode when requested (default: false)
|
|
365
|
+
disable_same_text_fallback = false # Disable fallback translation when LLM output matches input text (default: false)
|
|
364
366
|
pool-max-workers = 8 # Maximum worker threads for task processing (defaults to QPS value if not set)
|
|
365
367
|
|
|
366
368
|
# Glossary Options (Optional)
|
|
@@ -195,6 +195,7 @@ uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model
|
|
|
195
195
|
- `--openai`: Use OpenAI for translation (default: False)
|
|
196
196
|
- `--custom-system-prompt`: Custom system prompt for translation.
|
|
197
197
|
- `--add-formula-placehold-hint`: Add formula placeholder hint for translation. (Currently not recommended, it may affect translation quality, default: False)
|
|
198
|
+
- `--disable-same-text-fallback`: Disable fallback translation when LLM output matches input text. (default: False)
|
|
198
199
|
- `--pool-max-workers`: Maximum number of worker threads for internal task processing pools. If not specified, defaults to QPS value. This parameter directly sets the worker count, replacing previous QPS-based dynamic calculations.
|
|
199
200
|
- `--no-auto-extract-glossary`: Disable automatic term extraction. If this flag is present, the step is skipped. Defaults to enabled.
|
|
200
201
|
|
|
@@ -305,6 +306,7 @@ openai-model = "gpt-4o-mini"
|
|
|
305
306
|
openai-base-url = "https://api.openai.com/v1"
|
|
306
307
|
openai-api-key = "your-api-key-here"
|
|
307
308
|
enable-json-mode-if-requested = false # Enable JSON mode when requested (default: false)
|
|
309
|
+
disable_same_text_fallback = false # Disable fallback translation when LLM output matches input text (default: false)
|
|
308
310
|
pool-max-workers = 8 # Maximum worker threads for task processing (defaults to QPS value if not set)
|
|
309
311
|
|
|
310
312
|
# Glossary Options (Optional)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.24"
|
|
@@ -37,6 +37,8 @@ os_name = platform.system()
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class OnnxModel(DocLayoutModel):
|
|
40
|
+
_FIXED_IMGSZ = 1024 # fixed input size for static-shape CoreML
|
|
41
|
+
|
|
40
42
|
def __init__(self, model_path: str):
|
|
41
43
|
self.model_path = model_path
|
|
42
44
|
|
|
@@ -47,18 +49,52 @@ class OnnxModel(DocLayoutModel):
|
|
|
47
49
|
providers = []
|
|
48
50
|
|
|
49
51
|
available_providers = onnxruntime.get_available_providers()
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
use_coreml = os_name == "Darwin" and any(
|
|
53
|
+
re.match(r"coreml", p, re.IGNORECASE) for p in available_providers
|
|
54
|
+
)
|
|
55
|
+
if use_coreml:
|
|
56
|
+
# Fix input shapes to [1, 3, 1024, 1024] so CoreML can take over
|
|
57
|
+
# 96%+ of the graph nodes (658/681) instead of just 3/823.
|
|
58
|
+
model = self._make_static_model(model, self._FIXED_IMGSZ)
|
|
59
|
+
providers = [
|
|
60
|
+
"CoreMLExecutionProvider",
|
|
61
|
+
"CPUExecutionProvider",
|
|
62
|
+
]
|
|
63
|
+
logger.info(
|
|
64
|
+
"Using CoreMLExecutionProvider with static input "
|
|
65
|
+
f"[1, 3, {self._FIXED_IMGSZ}, {self._FIXED_IMGSZ}]"
|
|
66
|
+
)
|
|
67
|
+
else:
|
|
68
|
+
for provider in available_providers:
|
|
69
|
+
# disable dml|cuda|
|
|
70
|
+
# directml/cuda may encounter problems under special circumstances
|
|
71
|
+
if re.match(r"cpu", provider, re.IGNORECASE):
|
|
72
|
+
logger.info(f"Available Provider: {provider}")
|
|
73
|
+
providers.append(provider)
|
|
56
74
|
self.model = onnxruntime.InferenceSession(
|
|
57
75
|
model.SerializeToString(),
|
|
58
76
|
providers=providers,
|
|
59
77
|
)
|
|
60
78
|
self.lock = threading.Lock()
|
|
61
79
|
|
|
80
|
+
@staticmethod
|
|
81
|
+
def _make_static_model(model, imgsz):
|
|
82
|
+
"""Rewrite dynamic input dims to fixed [1, 3, imgsz, imgsz] and run
|
|
83
|
+
shape inference so all intermediate shapes become static."""
|
|
84
|
+
from onnx import shape_inference
|
|
85
|
+
|
|
86
|
+
for inp in model.graph.input:
|
|
87
|
+
if inp.name == "images":
|
|
88
|
+
dim = inp.type.tensor_type.shape.dim
|
|
89
|
+
for i, val in enumerate([1, 3, imgsz, imgsz]):
|
|
90
|
+
dim[i].ClearField("dim_param")
|
|
91
|
+
dim[i].dim_value = val
|
|
92
|
+
try:
|
|
93
|
+
model = shape_inference.infer_shapes(model)
|
|
94
|
+
except Exception:
|
|
95
|
+
pass # best-effort; CoreML still benefits from fixed input
|
|
96
|
+
return model
|
|
97
|
+
|
|
62
98
|
@staticmethod
|
|
63
99
|
def from_pretrained():
|
|
64
100
|
pth = get_doclayout_onnx_model_path()
|
|
@@ -97,9 +133,9 @@ class OnnxModel(DocLayoutModel):
|
|
|
97
133
|
interpolation=cv2.INTER_LINEAR,
|
|
98
134
|
)
|
|
99
135
|
|
|
100
|
-
#
|
|
101
|
-
pad_w =
|
|
102
|
-
pad_h =
|
|
136
|
+
# Pad to full target size (enables static-shape CoreML acceleration)
|
|
137
|
+
pad_w = new_w - resized_w
|
|
138
|
+
pad_h = new_h - resized_h
|
|
103
139
|
top, bottom = pad_h // 2, pad_h - pad_h // 2
|
|
104
140
|
left, right = pad_w // 2, pad_w - pad_w // 2
|
|
105
141
|
|
|
@@ -43,8 +43,12 @@ def get_descendant_fonts(doc, xref):
|
|
|
43
43
|
def get_glyph_bbox(face, g):
|
|
44
44
|
try:
|
|
45
45
|
face.load_glyph(g, freetype.FT_LOAD_NO_SCALE)
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
outline = face.glyph.outline
|
|
47
|
+
if outline.contours:
|
|
48
|
+
cbox = outline.get_bbox()
|
|
49
|
+
return cbox.xMin, cbox.yMin, cbox.xMax, cbox.yMax
|
|
50
|
+
else:
|
|
51
|
+
return 0, 0, 0, 0
|
|
48
52
|
except Exception:
|
|
49
53
|
return 0, 0, 0, 0
|
|
50
54
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import io
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
import pymupdf
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def merge_bbox(bbox_list, factor=1):
|
|
8
|
+
if bbox_list:
|
|
9
|
+
base = bbox_list[0]
|
|
10
|
+
for bbox in bbox_list[1:]:
|
|
11
|
+
base.include_rect(bbox)
|
|
12
|
+
x0, y0, x1, y1 = [v / factor for v in tuple(base)]
|
|
13
|
+
return x0, -y1, x1, -y0
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def get_type3_bbox(doc, obj):
|
|
17
|
+
bbox_list = [(0, 0, 0, 0)] * 256
|
|
18
|
+
first = int(doc.xref_get_key(obj, "FirstChar")[1])
|
|
19
|
+
last = int(doc.xref_get_key(obj, "LastChar")[1])
|
|
20
|
+
factor_text = doc.xref_get_key(obj, "FontMatrix")[1]
|
|
21
|
+
factor = 1
|
|
22
|
+
if factor_m := re.search(r"(\d+)?\.\d+", factor_text):
|
|
23
|
+
factor = float(factor_m.group(0))
|
|
24
|
+
page = doc.new_page(width=10, height=10)
|
|
25
|
+
doc.xref_set_key(page.xref, "Resources", "<<>>")
|
|
26
|
+
doc.xref_set_key(page.xref, "Resources/Font", f"<</T0 {obj} 0 R>>")
|
|
27
|
+
text = doc.get_new_xref()
|
|
28
|
+
doc.update_object(text, "<<>>")
|
|
29
|
+
for x in range(first, last + 1):
|
|
30
|
+
doc.update_stream(text, b"1 0 0 1 0 10 cm BT /T0 1 Tf <%02X> Tj ET" % x)
|
|
31
|
+
doc.xref_set_key(page.xref, "Contents", f"{text} 0 R")
|
|
32
|
+
char_data = page.get_svg_image(text_as_path=True)
|
|
33
|
+
char_doc = pymupdf.Document(stream=io.BytesIO(char_data.encode("U8")))
|
|
34
|
+
char_bbox = []
|
|
35
|
+
for element in char_doc:
|
|
36
|
+
for item in element.get_drawings():
|
|
37
|
+
char_bbox.append(item["rect"])
|
|
38
|
+
if char_bbox_merged := merge_bbox(char_bbox, factor):
|
|
39
|
+
bbox_list[x] = char_bbox_merged
|
|
40
|
+
doc.delete_page(-1)
|
|
41
|
+
return bbox_list
|
|
@@ -485,10 +485,13 @@ def reproduce_cmap(doc):
|
|
|
485
485
|
assert doc
|
|
486
486
|
font_set = set()
|
|
487
487
|
for page in doc:
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
488
|
+
try:
|
|
489
|
+
font_list = page.get_fonts()
|
|
490
|
+
for font in font_list:
|
|
491
|
+
if font[1] == "ttf" and font[3] in FONT_NAMES and ".ttf" in font[4]:
|
|
492
|
+
font_set.add(font)
|
|
493
|
+
except Exception as e:
|
|
494
|
+
logger.error(f"Error in getting page fonts: {e}")
|
|
492
495
|
for font in font_set:
|
|
493
496
|
reproduce_one_font(doc, font[0])
|
|
494
497
|
return doc
|
|
@@ -1399,7 +1402,7 @@ class PDFCreater:
|
|
|
1399
1402
|
auto_extracted_glossary_path = self.translation_config.get_output_file_path(
|
|
1400
1403
|
f"{basename}{debug_suffix}.{translation_config.lang_out}.glossary.csv"
|
|
1401
1404
|
)
|
|
1402
|
-
with auto_extracted_glossary_path.open("w", encoding="utf-8") as f:
|
|
1405
|
+
with auto_extracted_glossary_path.open("w", encoding="utf-8-sig") as f:
|
|
1403
1406
|
logger.info(
|
|
1404
1407
|
f"save auto extracted glossary to {auto_extracted_glossary_path}"
|
|
1405
1408
|
)
|
|
@@ -15,8 +15,10 @@ import tiktoken
|
|
|
15
15
|
import babeldoc.pdfminer.pdfinterp
|
|
16
16
|
from babeldoc.format.pdf.babelpdf.base14 import get_base14_bbox
|
|
17
17
|
from babeldoc.format.pdf.babelpdf.cidfont import get_cidfont_bbox
|
|
18
|
+
from babeldoc.format.pdf.babelpdf.cidfont import get_glyph_bbox
|
|
18
19
|
from babeldoc.format.pdf.babelpdf.encoding import WinAnsiEncoding
|
|
19
20
|
from babeldoc.format.pdf.babelpdf.encoding import get_type1_encoding
|
|
21
|
+
from babeldoc.format.pdf.babelpdf.type3 import get_type3_bbox
|
|
20
22
|
from babeldoc.format.pdf.babelpdf.utils import guarded_bbox
|
|
21
23
|
from babeldoc.format.pdf.document_il import il_version_1
|
|
22
24
|
from babeldoc.format.pdf.document_il.utils import zstd_helper
|
|
@@ -111,15 +113,9 @@ def indirect(obj):
|
|
|
111
113
|
return int(obj[1].split(" ")[0])
|
|
112
114
|
|
|
113
115
|
|
|
114
|
-
def get_glyph_cbox(face, g):
|
|
115
|
-
face.load_glyph(g, freetype.FT_LOAD_NO_SCALE)
|
|
116
|
-
cbox = face.glyph.outline.get_bbox()
|
|
117
|
-
return cbox.xMin, cbox.yMin, cbox.xMax, cbox.yMax
|
|
118
|
-
|
|
119
|
-
|
|
120
116
|
def get_char_cbox(face, idx):
|
|
121
117
|
g = face.get_char_index(idx)
|
|
122
|
-
return
|
|
118
|
+
return get_glyph_bbox(face, g)
|
|
123
119
|
|
|
124
120
|
|
|
125
121
|
def get_name_cbox(face, name):
|
|
@@ -127,7 +123,7 @@ def get_name_cbox(face, name):
|
|
|
127
123
|
if isinstance(name, str):
|
|
128
124
|
name = name.encode("utf-8")
|
|
129
125
|
g = face.get_name_index(name)
|
|
130
|
-
return
|
|
126
|
+
return get_glyph_bbox(face, g)
|
|
131
127
|
return (0, 0, 0, 0)
|
|
132
128
|
|
|
133
129
|
|
|
@@ -798,6 +794,8 @@ class ILCreater:
|
|
|
798
794
|
bbox_list = get_base14_bbox(obj_val[1:])
|
|
799
795
|
if cid_bbox := get_cidfont_bbox(self.mupdf, xobj_id):
|
|
800
796
|
bbox_list = cid_bbox
|
|
797
|
+
if self.mupdf.xref_get_key(xobj_id, "Subtype")[1] == "/Type3":
|
|
798
|
+
bbox_list = get_type3_bbox(self.mupdf, xobj_id)
|
|
801
799
|
return bbox_list, cmap
|
|
802
800
|
|
|
803
801
|
def create_graphic_state(
|
|
@@ -413,7 +413,7 @@ class AutomaticTermExtractor:
|
|
|
413
413
|
"auto_extractor_glossary.csv"
|
|
414
414
|
)
|
|
415
415
|
logger.debug(f"save auto extracted glossary to {path}")
|
|
416
|
-
with Path(path).open("w", encoding="utf-8") as f:
|
|
416
|
+
with Path(path).open("w", encoding="utf-8-sig") as f:
|
|
417
417
|
auto_extracted_glossary = self.shared_context.auto_extracted_glossary
|
|
418
418
|
if auto_extracted_glossary:
|
|
419
419
|
f.write(auto_extracted_glossary.to_csv())
|
{babeldoc-0.5.22 → babeldoc-0.5.24}/babeldoc/format/pdf/document_il/midend/il_translator_llm_only.py
RENAMED
|
@@ -761,7 +761,12 @@ class ILTranslatorLLMOnly:
|
|
|
761
761
|
input_token_count = self.calc_token_count(trimed_input)
|
|
762
762
|
output_token_count = self.calc_token_count(output_unicode)
|
|
763
763
|
|
|
764
|
-
|
|
764
|
+
same_as_input = trimed_input == output_unicode
|
|
765
|
+
if (
|
|
766
|
+
same_as_input
|
|
767
|
+
and input_token_count > 10
|
|
768
|
+
and not self.translation_config.disable_same_text_fallback
|
|
769
|
+
):
|
|
765
770
|
llm_translate_tracker.set_error_message(
|
|
766
771
|
"Translation result is the same as input, fallback."
|
|
767
772
|
)
|
|
@@ -781,16 +786,19 @@ class ILTranslatorLLMOnly:
|
|
|
781
786
|
llm_translate_tracker.set_placeholder_full_match()
|
|
782
787
|
continue
|
|
783
788
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
f"Translation result edit distance is too small. distance: {edit_distance}, input: {input_unicode}, output: {output_unicode}"
|
|
788
|
-
)
|
|
789
|
-
logger.warning(
|
|
790
|
-
f"Translation result edit distance is too small. distance: {edit_distance}, input: {input_unicode}, output: {output_unicode}"
|
|
789
|
+
if not self.translation_config.disable_same_text_fallback:
|
|
790
|
+
edit_distance = Levenshtein.distance(
|
|
791
|
+
input_unicode, output_unicode
|
|
791
792
|
)
|
|
792
|
-
|
|
793
|
-
|
|
793
|
+
if edit_distance < 5 and input_token_count > 20:
|
|
794
|
+
llm_translate_tracker.set_error_message(
|
|
795
|
+
f"Translation result edit distance is too small. distance: {edit_distance}, input: {input_unicode}, output: {output_unicode}"
|
|
796
|
+
)
|
|
797
|
+
logger.warning(
|
|
798
|
+
f"Translation result edit distance is too small. distance: {edit_distance}, input: {input_unicode}, output: {output_unicode}"
|
|
799
|
+
)
|
|
800
|
+
llm_translate_tracker.set_placeholder_full_match()
|
|
801
|
+
continue
|
|
794
802
|
# Apply the translation to the paragraph
|
|
795
803
|
self.il_translator.post_translate_paragraph(
|
|
796
804
|
inputs[id_][2],
|
|
@@ -135,7 +135,7 @@ class ResultMerger:
|
|
|
135
135
|
auto_extracted_glossary_path = self.config.get_output_file_path(
|
|
136
136
|
f"{basename}{debug_suffix}.{self.config.lang_out}.glossary.csv"
|
|
137
137
|
)
|
|
138
|
-
with auto_extracted_glossary_path.open("w", encoding="utf-8") as f:
|
|
138
|
+
with auto_extracted_glossary_path.open("w", encoding="utf-8-sig") as f:
|
|
139
139
|
logger.info(
|
|
140
140
|
f"save auto extracted glossary to {auto_extracted_glossary_path}"
|
|
141
141
|
)
|
|
@@ -199,6 +199,7 @@ class TranslationConfig:
|
|
|
199
199
|
term_extraction_translator: BaseTranslator | None = None,
|
|
200
200
|
metadata_extra_data: str | None = None,
|
|
201
201
|
term_pool_max_workers: int | None = None,
|
|
202
|
+
disable_same_text_fallback: bool = False,
|
|
202
203
|
):
|
|
203
204
|
self.translator = translator
|
|
204
205
|
self.term_extraction_translator = term_extraction_translator or translator
|
|
@@ -354,6 +355,7 @@ class TranslationConfig:
|
|
|
354
355
|
"completion_tokens": 0,
|
|
355
356
|
"cache_hit_prompt_tokens": 0,
|
|
356
357
|
}
|
|
358
|
+
self.disable_same_text_fallback = disable_same_text_fallback
|
|
357
359
|
|
|
358
360
|
if self.ocr_workaround:
|
|
359
361
|
self.remove_non_formula_lines = False
|
|
@@ -26,7 +26,7 @@ from babeldoc.translator.translator import OpenAITranslator
|
|
|
26
26
|
from babeldoc.translator.translator import set_translate_rate_limiter
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
|
-
__version__ = "0.5.
|
|
29
|
+
__version__ = "0.5.24"
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def create_parser():
|
|
@@ -269,6 +269,12 @@ def create_parser():
|
|
|
269
269
|
default=False,
|
|
270
270
|
help="Add formula placeholder hint for translation. (Currently not recommended, it may affect translation quality, default: False)",
|
|
271
271
|
)
|
|
272
|
+
translation_group.add_argument(
|
|
273
|
+
"--disable-same-text-fallback",
|
|
274
|
+
action="store_true",
|
|
275
|
+
default=False,
|
|
276
|
+
help="Disable fallback translation when LLM output matches input text. (default: False)",
|
|
277
|
+
)
|
|
272
278
|
translation_group.add_argument(
|
|
273
279
|
"--glossary-files",
|
|
274
280
|
type=str,
|
|
@@ -703,6 +709,7 @@ async def main():
|
|
|
703
709
|
custom_system_prompt=args.custom_system_prompt,
|
|
704
710
|
working_dir=working_dir,
|
|
705
711
|
add_formula_placehold_hint=args.add_formula_placehold_hint,
|
|
712
|
+
disable_same_text_fallback=args.disable_same_text_fallback,
|
|
706
713
|
glossaries=loaded_glossaries,
|
|
707
714
|
pool_max_workers=args.pool_max_workers,
|
|
708
715
|
auto_extract_glossary=args.auto_extract_glossary,
|
|
@@ -344,9 +344,15 @@ class OpenAITranslator(BaseTranslator):
|
|
|
344
344
|
self.prompt_token_count.inc(response.usage.prompt_tokens)
|
|
345
345
|
if response.usage and response.usage.completion_tokens:
|
|
346
346
|
self.completion_token_count.inc(response.usage.completion_tokens)
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
# Support both response.usage.prompt_cache_hit_tokens and response.prompt_tokens_details.cached_tokens
|
|
348
|
+
hit_count = 0
|
|
349
|
+
if response.usage and hasattr(response.usage, "prompt_cache_hit_tokens"):
|
|
350
|
+
hit_count = getattr(response.usage, "prompt_cache_hit_tokens", 0)
|
|
351
|
+
if hasattr(response, "prompt_tokens_details") and getattr(
|
|
352
|
+
response.prompt_tokens_details, "cached_tokens", 0
|
|
349
353
|
):
|
|
354
|
+
hit_count += getattr(response.prompt_tokens_details, "cached_tokens", 0)
|
|
355
|
+
if hit_count:
|
|
350
356
|
self.cache_hit_prompt_token_count.inc(hit_count)
|
|
351
357
|
except Exception as e:
|
|
352
358
|
logger.exception("Error updating token count")
|
|
@@ -46,6 +46,12 @@ Please pay special attention to:
|
|
|
46
46
|
>
|
|
47
47
|
> Due to the current high rate of code changes, this project only accepts small PRs. If you would like to suggest a change and you include a patch as a proof-of-concept, that would be great. However, please do not be offended if we rewrite your patch from scratch.
|
|
48
48
|
>
|
|
49
|
+
> In addition, we do not accept PRs involving the following changes:
|
|
50
|
+
> 1. PRs that modify prompts.
|
|
51
|
+
> 2. Adding GUI or other features directly targeting end users to this project. (Exceptions granted by maintainers in issues are excluded.)
|
|
52
|
+
> 3. PRs that do not comply with this specification.
|
|
53
|
+
> 4. Other PRs that maintainers deem inappropriate.
|
|
54
|
+
>
|
|
49
55
|
> **This project cannot accept all PRs. We recommend that you discuss with the maintainers via [Issue](https://github.com/funstory-ai/BabelDOC/issues) before submitting a PR.**
|
|
50
56
|
|
|
51
57
|
[//]: # (> We welcome pull requests and will review your contributions.)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.24"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -42,7 +42,7 @@ dependencies = [
|
|
|
42
42
|
"scikit-image>=0.25.2",
|
|
43
43
|
"freetype-py>=2.5.1",
|
|
44
44
|
"tiktoken>=0.9.0",
|
|
45
|
-
"
|
|
45
|
+
"Levenshtein>=0.27.1",
|
|
46
46
|
"opencv-python-headless>=4.10.0.84",
|
|
47
47
|
"rapidocr-onnxruntime>=1.4.4",
|
|
48
48
|
"pyzstd>=0.17.0",
|
|
@@ -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.24"
|
|
166
166
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
167
167
|
|
|
168
168
|
[bumpver.file_patterns]
|
babeldoc-0.5.22/.cursorignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.5.22"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|