contextweave 0.3.0__tar.gz → 0.3.1__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.
- {contextweave-0.3.0 → contextweave-0.3.1}/PKG-INFO +1 -1
- contextweave-0.3.1/context_aware_translation/core/galgame_document_handler.py +65 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/galgame.py +42 -6
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/export_ops.py +0 -2
- {contextweave-0.3.0 → contextweave-0.3.1}/pyproject.toml +1 -1
- contextweave-0.3.1/tests/core/test_galgame_document_handler.py +57 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_galgame.py +42 -21
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_import_export.py +3 -4
- {contextweave-0.3.0 → contextweave-0.3.1}/uv.lock +1 -1
- contextweave-0.3.0/context_aware_translation/core/galgame_document_handler.py +0 -101
- contextweave-0.3.0/tests/core/test_galgame_document_handler.py +0 -98
- {contextweave-0.3.0 → contextweave-0.3.1}/.github/workflows/release.yml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/.gitignore +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/LICENSE +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/Makefile +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/README.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/README_ZH.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/cat-ui.spec +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/files/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/files/glossary_io.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/application_event_bridge.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/task_engine.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/base_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/batch_task_overlap_guard.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/batch_translation_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/chunk_retranslation_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/export_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/glossary_export_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/glossary_extraction_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/glossary_review_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/glossary_translation_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/image_reembedding_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/import_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/ocr_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/operation_tracker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/translate_and_export_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/translation_manga_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/translation_text_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/app_identity.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/composition.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/app_setup.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/common.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/document.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/project_setup.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/projects.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/queue.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/terms.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/contracts/work.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/errors.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/events.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/runtime.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/_export_support.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/app_setup.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/document.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/project_setup.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/projects.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/queue.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/terms.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/application/services/work.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/config_file.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/galgame_skill.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/main.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/output.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/runtime.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/cli/wait.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/config.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/cancellation.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/context_extractor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/context_manager.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/manga_document_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/models.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/progress.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/term_memory.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/term_memory_builder.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/core/translation_strategies.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/content/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/content/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/content/ocr_content.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/content/ocr_items.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_container.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/container_model.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/container_patch.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/container_reader.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/container_shared.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/container_writer.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/inline_markers.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/nav_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/slot_lines.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_support/xml_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/epub_xhtml_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/manga.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/manga_alignment.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/manga_reembed_planner.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/pdf.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/scanned_book.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/subtitle.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/documents/text.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/batch_jobs/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/batch_jobs/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/batch_jobs/base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/batch_jobs/gemini_gateway.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/client.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/epub_ocr.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/extractor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/glossary_translator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_backend_base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_backends/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_backends/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_backends/gemini_backend.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_backends/openai_backend.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_backends/qwen_backend.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/image_generator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/language_detector.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/manga_ocr.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/manga_translator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/ocr.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/reviewer.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/session_trace.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/summarizor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/token_tracker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/translation_strategies.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/llm/translator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/hk2s.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/jp2s.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/s2hk.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/s2t.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/s2tw.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/s2twp.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/t2hk.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/t2s.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/t2tw.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/tw2s.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/config/tw2sp.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/HKVariants.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/HKVariantsPhrases.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/HKVariantsRev.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/HKVariantsRevPhrases.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/JPVariants.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/JPVariantsRev.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/STCharacters.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/STPhrases.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TSCharacters.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TSPhrases.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TWPhrases.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TWPhrasesRev.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TWVariants.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TWVariantsRev.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/opencc/dictionary/TWVariantsRevPhrases.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/tokenizers/deepseek-v3/special_tokens_map.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/tokenizers/deepseek-v3/tokenizer.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/resources/tokenizers/deepseek-v3/tokenizer_config.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/library/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/library/book_manager.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/models/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/models/book.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/models/config_profile.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/models/endpoint_profile.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/repositories/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/repositories/document_repository.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/repositories/llm_batch_store.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/repositories/task_store.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/repositories/term_repository.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/repositories/translation_batch_task_store.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/schema/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/schema/book_db.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/schema/registry_db.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/storage/sqlite_locking.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/chrome_sizing.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/constants.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/app_settings_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/app_setup_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/document_images_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/document_ocr_tab.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/document_translation_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/document_workspace_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/library_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/project_settings_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/queue_drawer_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/terms_table_widget.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/terms_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/work_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/features/workflow_profile_editor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/i18n.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/json_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/main.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/main_window.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/BootstrapProbe.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/app/AppShellChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/dialogs/app_settings/AppSettingsDialogChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/dialogs/app_settings/AppSettingsPane.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/dialogs/project_settings/ProjectSettingsDialogChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/dialogs/project_settings/ProjectSettingsPane.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/document/DocumentShellChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/document/export/DocumentExportPaneChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/document/images/DocumentImagesPaneChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/document/ocr/DocumentOCRPaneChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/document/translation/DocumentTranslationPaneChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/project/ProjectShellChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/project/terms/TermsPaneChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/project/work_home/WorkHomeChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml/queue/QueueShellChrome.qml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/qml_resources.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/resources/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/resources/styles.qss +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/app_settings_dialog_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/app_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/document_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/hybrid.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/project_settings_dialog_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/project_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/shell_hosts/queue_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/sleep_inhibitor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/startup.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/tips.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/translations/zh_CN.qm +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/translations/zh_CN.ts +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/app_settings_dialog.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/app_settings_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/app_shell.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/document_export_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/document_images_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/document_ocr_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/document_shell.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/document_translation_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/project_settings_dialog.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/project_settings_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/project_shell.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/queue_shell.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/router.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/terms_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/viewmodels/work_home.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/widgets/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/widgets/hybrid_controls.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/widgets/image_viewer.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/widgets/progress_widget.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/widgets/table_support.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/ui/window_controllers.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/chunking.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/cjk_normalize.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/compression_marker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/file_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/hard_wrap.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/hashing.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/image_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/llm_json_cleaner.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/markdown_escape.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/pandoc_export.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/semantic_chunker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/string_similarity.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/utils/symbol_check.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/bootstrap.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/image_fetcher.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/bootstrap_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/glossary_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/import_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/import_support.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/ocr_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/translation_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/runtime.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/session.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/task_runtime.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/claims.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/engine_core.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/exceptions.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/execution/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/execution/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/execution/batch_translation_executor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/execution/batch_translation_ops.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/glossary_preflight.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/batch_translation.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/chunk_retranslation.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/glossary_export.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/glossary_extraction.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/glossary_review.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/glossary_translation.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/image_reembedding.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/ocr.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/translate_and_export.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/translation_manga.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/handlers/translation_text.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/models.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/translate_and_export_support.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/tasks/worker_deps.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/demo/The Count of Monte Cristo.epub +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/demo//345/237/272/347/235/243/345/261/261/344/274/257/347/210/265.epub" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/.nojekyll +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/examples/contextweave-cli.yaml +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/index.html +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/project-terms-manual-entry-ux.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/API/351/205/215/347/275/256.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/latest_new_project_dialog.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/latest_project_work_overview.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/latest_projects_overview.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/latest_setup_wizard_provider_selection.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/latest_setup_wizard_workflow_profile_review.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN/latest_terms_overview.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//345/257/274/345/205/245.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//345/257/274/345/207/272.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//346/226/260/351/241/271/347/233/256.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//346/234/257/350/257/255.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//347/277/273/350/257/221.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//350/256/276/347/275/256.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//350/256/276/347/275/256/345/220/221/345/257/274.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/CN//350/256/276/347/275/256/347/273/223/346/235/237.png" +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/APISetup.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/Export.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/Import.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/InitialSetup.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/Language.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/NewProject.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/Terms.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/Translate.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/TranslateAndExport.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/Wizard.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/latest_new_project_dialog.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/latest_project_work_overview.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/latest_projects_overview.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/latest_setup_wizard_provider_selection.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/latest_setup_wizard_workflow_profile_review.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/screenshots/EN/latest_terms_overview.png +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/docs/styles.css +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/installer/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/installer/macos/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/installer/macos/entitlements.plist +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/installer/windows/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/scripts/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/scripts/build_ui.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/scripts/generate_readme_screenshots.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/scripts/run_ui_tests.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/adapters/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/adapters/files/test_glossary_io.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/fakes.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_composition.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_contracts.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_document_service.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_document_translation_service.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_events.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_export_services.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_queue_service.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_terms_service.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/application/test_ui_harness_pattern.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/architecture/test_migrated_ui_boundaries.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/architecture/test_packaging_hidden_imports.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/architecture/test_qml_ui_boundaries.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/cli/test_cli.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/config/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/config/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/config/test_endpoint_profiles.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/conftest.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/expected_batching_output.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test-terms.json +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_context_extractor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_context_manager.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_manga_document_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_models.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_noise_filtering_pipeline.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_term_memory_builder.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/core/test_translation_context_manager_strategy_api.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/data/test_chunk.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/data/test_chunk2.txt +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/content/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/content/test_ocr_content.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/content/test_ocr_items.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_epub.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_epub_container.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_epub_inline_markers.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_epub_xhtml_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_manga.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_manga_alignment.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_ocr_image_embedded_text.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_pdf.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_scanned_book.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_subtitle.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/documents/test_text.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/integration/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/integration/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/integration/test_business_logic.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_extractor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_extractor_unit.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_gemini_backend.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_gemini_batch_gateway.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_glossary_translator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_image_generator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_image_token_usage.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_language_detector.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_llm_client.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_manga_translator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_ocr.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_reviewer.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_session_trace.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_summarizor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_token_tracker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_token_usage_extraction.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/llm/test_translator.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_book_db.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_book_manager.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_document_repository.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_document_tables.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_llm_batch_store.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_task_store.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_term_repository.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_token_tracking.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/storage/test_translation_batch_task_store.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/test_logging_handlers.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/conftest.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/tasks/test_task_engine.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_settings_dialog_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_settings_dialog_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_settings_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_settings_pane_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_setup_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_app_shell_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_export_pane_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_images_pane_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_images_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_ocr_tab.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_shell_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_translation_pane_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_translation_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_document_workspace_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_i18n_progress_messages.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_image_viewer.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_library_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_main.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_main_window_shell.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_progress_widget.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_project_settings_dialog_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_project_settings_dialog_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_project_settings_pane.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_project_settings_pane_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_project_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_project_shell_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_qml_bootstrap.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_qml_viewmodel_harness.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_queue_drawer_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_queue_shell_host.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_queue_shell_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_shell_host_infrastructure.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_sleep_inhibitor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_terms_pane_viewmodel.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_terms_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_ui_clickthrough_smoke.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_viewmodel_base.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_work_view.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_worker_cancellation_reporting.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/test_workflow_profile_editor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_batch_task_overlap_guard.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_chunk_retranslation_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_config_snapshot_workers.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_glossary_export_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_glossary_review_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_ocr_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_operation_tracker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_translate_and_export_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_translation_manga_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/ui/workers/test_translation_text_task_worker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_chunking.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_cjk_normalize.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_file_utils.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_hard_wrap.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_hashing.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_llm_json_cleaner.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_markdown_escape.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_semantic_chunker.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_string_similarity.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/utils/test_symbol_check.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/execution/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/execution/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/execution/test_batch_translation_executor.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/AGENTS.md +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/__init__.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_batch_translation_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_chunk_retranslation_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_glossary_export_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_glossary_extraction_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_glossary_review_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_glossary_translation_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_image_reembedding_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_ocr_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_translate_and_export_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_translation_manga_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/handlers/test_translation_text_handler.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/test_claims.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/tasks/test_engine_core.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_glossary_ops_scoping.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_multi_document.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_ocr_required_for_translation.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_run_ocr.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_service_bootstrap_lock.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_service_cancellation_semantics.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_session.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_translator_image_fetcher.py +0 -0
- {contextweave-0.3.0 → contextweave-0.3.1}/tests/workflow/test_translator_import_path.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: contextweave
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: ContextWeave: context-aware document translation with glossary management
|
|
5
5
|
Project-URL: Homepage, https://github.com/bot-32142/ContextWeave
|
|
6
6
|
Project-URL: Documentation, https://bot-32142.github.io/ContextWeave/
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from context_aware_translation.core.cancellation import raise_if_cancelled
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from context_aware_translation.core.context_manager import TranslationContextManager
|
|
10
|
+
from context_aware_translation.core.progress import ProgressCallback
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class GalgameDocumentHandler:
|
|
14
|
+
"""DocumentTypeHandler for galgame documents using the generic text pipeline."""
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
*,
|
|
19
|
+
concurrency: int = 5,
|
|
20
|
+
batch_size: int = 0,
|
|
21
|
+
max_tokens_per_batch: int = 2000,
|
|
22
|
+
) -> None:
|
|
23
|
+
self._concurrency = max(1, concurrency)
|
|
24
|
+
self._batch_size = batch_size
|
|
25
|
+
self._max_tokens_per_batch = max(1, max_tokens_per_batch)
|
|
26
|
+
|
|
27
|
+
def add_text(
|
|
28
|
+
self,
|
|
29
|
+
text: str,
|
|
30
|
+
max_token_size_per_chunk: int,
|
|
31
|
+
document_id: int,
|
|
32
|
+
manager: TranslationContextManager,
|
|
33
|
+
) -> int:
|
|
34
|
+
"""Let the normal semantic chunker group galgame text."""
|
|
35
|
+
return manager.add_text(text, max_token_size_per_chunk, document_id)
|
|
36
|
+
|
|
37
|
+
async def translate_chunks(
|
|
38
|
+
self,
|
|
39
|
+
document_ids: list[int],
|
|
40
|
+
manager: TranslationContextManager,
|
|
41
|
+
force: bool = False,
|
|
42
|
+
source_ids: list[int] | None = None,
|
|
43
|
+
cancel_check: Callable[[], bool] | None = None,
|
|
44
|
+
progress_callback: ProgressCallback | None = None,
|
|
45
|
+
) -> None:
|
|
46
|
+
"""Delegate to generic text translation with configured batching."""
|
|
47
|
+
_ = source_ids
|
|
48
|
+
raise_if_cancelled(cancel_check)
|
|
49
|
+
await manager.translate_chunks(
|
|
50
|
+
concurrency=self._concurrency,
|
|
51
|
+
batch_size=self._batch_size,
|
|
52
|
+
max_tokens_per_batch=self._max_tokens_per_batch,
|
|
53
|
+
document_ids=document_ids,
|
|
54
|
+
force=force,
|
|
55
|
+
cancel_check=cancel_check,
|
|
56
|
+
progress_callback=progress_callback,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def get_translated_lines(
|
|
60
|
+
self,
|
|
61
|
+
document_id: int,
|
|
62
|
+
manager: TranslationContextManager,
|
|
63
|
+
) -> list[str]:
|
|
64
|
+
"""Use the normal chunk concatenation and newline split behavior."""
|
|
65
|
+
return manager.get_translated_lines(document_id)
|
|
@@ -1148,11 +1148,7 @@ class GalgameDocument(Document):
|
|
|
1148
1148
|
return 0
|
|
1149
1149
|
|
|
1150
1150
|
def get_text(self) -> str:
|
|
1151
|
-
|
|
1152
|
-
for source in self._ordered_sources():
|
|
1153
|
-
relative_path, text_content, adapter = _source_adapter(source)
|
|
1154
|
-
units.extend(adapter.extract_units(relative_path, text_content))
|
|
1155
|
-
return serialize_translation_units(units)
|
|
1151
|
+
return "\n".join(unit.text for unit in self._all_translation_units())
|
|
1156
1152
|
|
|
1157
1153
|
def get_glossary_seeds(self) -> tuple[GalgameGlossarySeed, ...]:
|
|
1158
1154
|
seeds: list[GalgameGlossarySeed] = []
|
|
@@ -1180,7 +1176,7 @@ class GalgameDocument(Document):
|
|
|
1180
1176
|
) -> int:
|
|
1181
1177
|
_ = progress_callback
|
|
1182
1178
|
raise_if_cancelled(cancel_check)
|
|
1183
|
-
self._translated_lines =
|
|
1179
|
+
self._translated_lines = _expand_galgame_export_lines(lines, self._all_translation_units())
|
|
1184
1180
|
return len(lines)
|
|
1185
1181
|
|
|
1186
1182
|
async def reembed(
|
|
@@ -1251,6 +1247,13 @@ class GalgameDocument(Document):
|
|
|
1251
1247
|
sources = cast("list[dict[str, object]]", self.repo.get_document_sources(self.document_id))
|
|
1252
1248
|
return sorted(sources, key=_source_sequence_number)
|
|
1253
1249
|
|
|
1250
|
+
def _all_translation_units(self) -> list[TranslationUnit]:
|
|
1251
|
+
units: list[TranslationUnit] = []
|
|
1252
|
+
for source in self._ordered_sources():
|
|
1253
|
+
relative_path, text_content, adapter = _source_adapter(source)
|
|
1254
|
+
units.extend(adapter.extract_units(relative_path, text_content))
|
|
1255
|
+
return units
|
|
1256
|
+
|
|
1254
1257
|
def _source_translation_batches(
|
|
1255
1258
|
self,
|
|
1256
1259
|
) -> list[tuple[dict[str, object], GalgameAdapter, list[TranslationUnit], dict[str, str]]]:
|
|
@@ -1623,6 +1626,39 @@ def _safe_output_path(output_folder: Path, relative_path: str) -> Path:
|
|
|
1623
1626
|
return output_folder.joinpath(*relative.parts)
|
|
1624
1627
|
|
|
1625
1628
|
|
|
1629
|
+
def _expand_galgame_export_lines(lines: list[str], units: list[TranslationUnit]) -> list[str]:
|
|
1630
|
+
translated_lines: list[str] = []
|
|
1631
|
+
for line in lines:
|
|
1632
|
+
translated_lines.extend(_split_galgame_chunk_translation(_coerce_export_line_to_translation(line)))
|
|
1633
|
+
|
|
1634
|
+
expanded: list[str] = []
|
|
1635
|
+
unit_index = 0
|
|
1636
|
+
line_index = 0
|
|
1637
|
+
while unit_index < len(units):
|
|
1638
|
+
source_line_count = _galgame_unit_line_count(units[unit_index].text)
|
|
1639
|
+
next_line_index = line_index + source_line_count
|
|
1640
|
+
if next_line_index > len(translated_lines):
|
|
1641
|
+
raise ValueError("Translated galgame line stream is shorter than the source unit stream.")
|
|
1642
|
+
expanded.append("\n".join(translated_lines[line_index:next_line_index]))
|
|
1643
|
+
unit_index += 1
|
|
1644
|
+
line_index = next_line_index
|
|
1645
|
+
|
|
1646
|
+
extra_lines = [line for line in translated_lines[line_index:] if line]
|
|
1647
|
+
if extra_lines:
|
|
1648
|
+
raise ValueError("Translated galgame line stream is longer than the source unit stream.")
|
|
1649
|
+
return expanded
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
def _split_galgame_chunk_translation(text: str) -> list[str]:
|
|
1653
|
+
normalized = text.replace("\r\n", "\n").replace("\r", "\n")
|
|
1654
|
+
return [decode_compressed_line(line) for line in normalized.split("\n")]
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
def _galgame_unit_line_count(text: str) -> int:
|
|
1658
|
+
normalized = text.replace("\r\n", "\n").replace("\r", "\n")
|
|
1659
|
+
return max(1, len(normalized.split("\n")))
|
|
1660
|
+
|
|
1661
|
+
|
|
1626
1662
|
def _coerce_export_line_to_translation(line: str) -> str:
|
|
1627
1663
|
decoded_line = decode_compressed_line(line)
|
|
1628
1664
|
if not decoded_line.strip().startswith("{"):
|
{contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/workflow/ops/export_ops.py
RENAMED
|
@@ -26,8 +26,6 @@ def get_lines_with_original_fallback(workflow: WorkflowContext, document: Docume
|
|
|
26
26
|
|
|
27
27
|
if document.document_type == "manga":
|
|
28
28
|
return [chunk.translation if chunk.is_translated and chunk.translation is not None else "" for chunk in chunks]
|
|
29
|
-
if document.document_type == "galgame":
|
|
30
|
-
return [chunk.translation if chunk.is_translated and chunk.translation is not None else chunk.text for chunk in chunks]
|
|
31
29
|
|
|
32
30
|
merged_chunks = [
|
|
33
31
|
chunk.translation if chunk.is_translated and chunk.translation is not None else chunk.text for chunk in chunks
|
|
@@ -7,7 +7,7 @@ packages = ["context_aware_translation"]
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "contextweave"
|
|
10
|
-
version = "0.3.
|
|
10
|
+
version = "0.3.1"
|
|
11
11
|
description = "ContextWeave: context-aware document translation with glossary management"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
license = "GPL-3.0-only"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from context_aware_translation.core.galgame_document_handler import GalgameDocumentHandler
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class DummyManager:
|
|
7
|
+
def __init__(self) -> None:
|
|
8
|
+
self.add_text_calls: list[tuple[str, int, int]] = []
|
|
9
|
+
self.translate_calls: list[dict[str, object]] = []
|
|
10
|
+
self.translated_lines = ["你好", "再见"]
|
|
11
|
+
|
|
12
|
+
def add_text(self, text: str, max_token_size_per_chunk: int, document_id: int) -> int:
|
|
13
|
+
self.add_text_calls.append((text, max_token_size_per_chunk, document_id))
|
|
14
|
+
return 42
|
|
15
|
+
|
|
16
|
+
async def translate_chunks(self, **kwargs): # noqa: ANN003
|
|
17
|
+
self.translate_calls.append(kwargs)
|
|
18
|
+
|
|
19
|
+
def get_translated_lines(self, document_id: int) -> list[str]:
|
|
20
|
+
assert document_id == 7
|
|
21
|
+
return self.translated_lines
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_galgame_handler_delegates_add_text_to_generic_pipeline() -> None:
|
|
25
|
+
manager = DummyManager()
|
|
26
|
+
handler = GalgameDocumentHandler()
|
|
27
|
+
|
|
28
|
+
last_chunk_id = handler.add_text("こんにちは\nまたね", 500, 7, manager)
|
|
29
|
+
|
|
30
|
+
assert last_chunk_id == 42
|
|
31
|
+
assert manager.add_text_calls == [("こんにちは\nまたね", 500, 7)]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_galgame_handler_delegates_get_translated_lines_to_generic_pipeline() -> None:
|
|
35
|
+
manager = DummyManager()
|
|
36
|
+
handler = GalgameDocumentHandler()
|
|
37
|
+
|
|
38
|
+
assert handler.get_translated_lines(7, manager) == ["你好", "再见"]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
async def test_galgame_handler_delegates_translation_with_configured_batching() -> None:
|
|
42
|
+
manager = DummyManager()
|
|
43
|
+
handler = GalgameDocumentHandler(concurrency=3, batch_size=0, max_tokens_per_batch=1234)
|
|
44
|
+
|
|
45
|
+
await handler.translate_chunks([7], manager, force=True)
|
|
46
|
+
|
|
47
|
+
assert manager.translate_calls == [
|
|
48
|
+
{
|
|
49
|
+
"concurrency": 3,
|
|
50
|
+
"batch_size": 0,
|
|
51
|
+
"max_tokens_per_batch": 1234,
|
|
52
|
+
"document_ids": [7],
|
|
53
|
+
"force": True,
|
|
54
|
+
"cancel_check": None,
|
|
55
|
+
"progress_callback": None,
|
|
56
|
+
}
|
|
57
|
+
]
|
|
@@ -20,7 +20,6 @@ from context_aware_translation.documents.galgame import (
|
|
|
20
20
|
TranslatorPlusPlusTransAdapter,
|
|
21
21
|
VnTextJsonAdapter,
|
|
22
22
|
WolfRpgXlsxAdapter,
|
|
23
|
-
deserialize_translation_unit_stream,
|
|
24
23
|
get_galgame_bridge_formats,
|
|
25
24
|
get_galgame_external_tool_specs,
|
|
26
25
|
inspect_galgame_external_helpers,
|
|
@@ -462,8 +461,7 @@ async def test_galgame_document_preserve_export_uses_imported_json_adapter_mime_
|
|
|
462
461
|
sources = repo.get_document_sources(row["document_id"])
|
|
463
462
|
assert sources[0]["mime_type"] == VnTextJsonAdapter.mime_type
|
|
464
463
|
|
|
465
|
-
|
|
466
|
-
assert [(unit.text, unit.speaker) for unit in units] == [("こんにちは", "Alice")]
|
|
464
|
+
assert document.get_text().splitlines() == ["こんにちは"]
|
|
467
465
|
|
|
468
466
|
await document.set_text(["你好"])
|
|
469
467
|
output_folder = tmp_path / "out"
|
|
@@ -492,8 +490,7 @@ async def test_galgame_document_preserve_export_writes_imported_xlsx_adapter(tmp
|
|
|
492
490
|
sources = repo.get_document_sources(row["document_id"])
|
|
493
491
|
assert sources[0]["mime_type"] == TppXlsxAdapter.mime_type
|
|
494
492
|
|
|
495
|
-
|
|
496
|
-
assert [(unit.text, unit.speaker) for unit in units] == [("こんにちは", "Alice")]
|
|
493
|
+
assert document.get_text().splitlines() == ["こんにちは"]
|
|
497
494
|
|
|
498
495
|
await document.set_text(["你好"])
|
|
499
496
|
output_folder = tmp_path / "out"
|
|
@@ -518,8 +515,7 @@ async def test_galgame_document_imports_and_exports_renpy_script(tmp_path: Path)
|
|
|
518
515
|
sources = repo.get_document_sources(row["document_id"])
|
|
519
516
|
assert sources[0]["mime_type"] == RenPyScriptAdapter.mime_type
|
|
520
517
|
|
|
521
|
-
|
|
522
|
-
assert [(unit.relative_path, unit.text, unit.speaker) for unit in units] == [("script.rpy", "こんにちは", "e")]
|
|
518
|
+
assert document.get_text().splitlines() == ["こんにちは"]
|
|
523
519
|
|
|
524
520
|
await document.set_text(["你好"])
|
|
525
521
|
output_folder = tmp_path / "out"
|
|
@@ -561,10 +557,7 @@ async def test_galgame_document_imports_and_exports_rpg_maker_folder(tmp_path: P
|
|
|
561
557
|
sources = repo.get_document_sources(row["document_id"])
|
|
562
558
|
assert sources[0]["mime_type"] == RpgMakerMvMzJsonAdapter.mime_type
|
|
563
559
|
|
|
564
|
-
|
|
565
|
-
assert [(unit.relative_path, unit.text, unit.context) for unit in units] == [
|
|
566
|
-
("www/data/Map001.json", "こんにちは", "Map event 1, page 1")
|
|
567
|
-
]
|
|
560
|
+
assert document.get_text().splitlines() == ["こんにちは"]
|
|
568
561
|
|
|
569
562
|
await document.set_text(["你好"])
|
|
570
563
|
output_folder = tmp_path / "out"
|
|
@@ -589,8 +582,7 @@ async def test_galgame_document_imports_single_rpg_maker_map_file(tmp_path: Path
|
|
|
589
582
|
sources = repo.get_document_sources(row["document_id"])
|
|
590
583
|
assert sources[0]["relative_path"] == "Map001.json"
|
|
591
584
|
assert sources[0]["mime_type"] == RpgMakerMvMzJsonAdapter.mime_type
|
|
592
|
-
|
|
593
|
-
assert [(unit.relative_path, unit.text) for unit in units] == [("Map001.json", "こんにちは")]
|
|
585
|
+
assert document.get_text().splitlines() == ["こんにちは"]
|
|
594
586
|
|
|
595
587
|
|
|
596
588
|
def test_galgame_folder_scan_rejects_rpg_maker_named_json_outside_data_folder(tmp_path: Path) -> None:
|
|
@@ -649,11 +641,7 @@ async def test_galgame_document_import_get_text_and_preserve_export(tmp_path: Pa
|
|
|
649
641
|
assert sources[0]["relative_path"] == "data/script.json"
|
|
650
642
|
|
|
651
643
|
document = GalgameDocument(repo, row["document_id"])
|
|
652
|
-
|
|
653
|
-
assert [(unit.relative_path, unit.unit_id, unit.text) for unit in units] == [
|
|
654
|
-
("data/script.json", "0", "こんにちは"),
|
|
655
|
-
("data/script.json", "1", "またね"),
|
|
656
|
-
]
|
|
644
|
+
assert document.get_text().splitlines() == ["こんにちは", "またね"]
|
|
657
645
|
|
|
658
646
|
await document.set_text(["你好", "再见"])
|
|
659
647
|
output_folder = tmp_path / "out"
|
|
@@ -663,6 +651,40 @@ async def test_galgame_document_import_get_text_and_preserve_export(tmp_path: Pa
|
|
|
663
651
|
assert patched == {"こんにちは": "你好", "またね": "再见"}
|
|
664
652
|
|
|
665
653
|
|
|
654
|
+
async def test_galgame_document_splits_grouped_chunk_translation_by_original_unit_lines(tmp_path: Path) -> None:
|
|
655
|
+
source = tmp_path / "script.json"
|
|
656
|
+
_write_mtool_json(source, {"こんにちは": "", "またね": ""})
|
|
657
|
+
repo = _setup_repo(tmp_path)
|
|
658
|
+
GalgameDocument.do_import(repo, source)
|
|
659
|
+
row = repo.get_document_row()
|
|
660
|
+
assert row is not None
|
|
661
|
+
document = GalgameDocument(repo, row["document_id"])
|
|
662
|
+
|
|
663
|
+
await document.set_text(["你好\n再见"])
|
|
664
|
+
output_folder = tmp_path / "out"
|
|
665
|
+
document.export_preserve_structure(output_folder)
|
|
666
|
+
|
|
667
|
+
patched = json.loads((output_folder / "script.json").read_text(encoding="utf-8"))
|
|
668
|
+
assert patched == {"こんにちは": "你好", "またね": "再见"}
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
async def test_galgame_document_splits_multiline_units_by_original_line_counts(tmp_path: Path) -> None:
|
|
672
|
+
source = tmp_path / "script.json"
|
|
673
|
+
_write_mtool_json(source, {"こんにちは\n世界": "", "またね": ""})
|
|
674
|
+
repo = _setup_repo(tmp_path)
|
|
675
|
+
GalgameDocument.do_import(repo, source)
|
|
676
|
+
row = repo.get_document_row()
|
|
677
|
+
assert row is not None
|
|
678
|
+
document = GalgameDocument(repo, row["document_id"])
|
|
679
|
+
|
|
680
|
+
await document.set_text(["你好\n世界\n再见"])
|
|
681
|
+
output_folder = tmp_path / "out"
|
|
682
|
+
document.export_preserve_structure(output_folder)
|
|
683
|
+
|
|
684
|
+
patched = json.loads((output_folder / "script.json").read_text(encoding="utf-8"))
|
|
685
|
+
assert patched == {"こんにちは\n世界": "你好\n世界", "またね": "再见"}
|
|
686
|
+
|
|
687
|
+
|
|
666
688
|
async def test_galgame_document_coerces_serialized_units_for_original_fallback(tmp_path: Path) -> None:
|
|
667
689
|
source = tmp_path / "script.json"
|
|
668
690
|
_write_mtool_json(source, {"こんにちは": "", "またね": ""})
|
|
@@ -680,7 +702,7 @@ async def test_galgame_document_coerces_serialized_units_for_original_fallback(t
|
|
|
680
702
|
assert patched == {"こんにちは": "こんにちは", "またね": "またね"}
|
|
681
703
|
|
|
682
704
|
|
|
683
|
-
async def test_galgame_export_raises_on_short_translation_stream(
|
|
705
|
+
async def test_galgame_export_raises_on_short_translation_stream() -> None:
|
|
684
706
|
mock_repo = MagicMock()
|
|
685
707
|
mock_repo.get_document_sources.return_value = [
|
|
686
708
|
{
|
|
@@ -690,7 +712,6 @@ async def test_galgame_export_raises_on_short_translation_stream(tmp_path: Path)
|
|
|
690
712
|
}
|
|
691
713
|
]
|
|
692
714
|
document = GalgameDocument(mock_repo, 1)
|
|
693
|
-
await document.set_text(["你好"])
|
|
694
715
|
|
|
695
716
|
with pytest.raises(ValueError, match="shorter than the source unit stream"):
|
|
696
|
-
document.
|
|
717
|
+
await document.set_text(["你好"])
|
|
@@ -640,10 +640,9 @@ Yes.
|
|
|
640
640
|
db.update_all_sources_text_added(doc_id)
|
|
641
641
|
|
|
642
642
|
chunks = translator.manager.term_repo.list_chunks(document_id=doc_id)
|
|
643
|
-
assert [chunk.text for chunk in chunks] == ["
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
chunk.translation = translation
|
|
643
|
+
assert [chunk.text for chunk in chunks] == ["こんにちは\nまたね"]
|
|
644
|
+
chunks[0].is_translated = True
|
|
645
|
+
chunks[0].translation = "你好\n再见"
|
|
647
646
|
translator.manager.term_repo.apply_batch(BatchUpdate(keyed_context=[], chunk_records=chunks))
|
|
648
647
|
|
|
649
648
|
await _export_preserve_structure(translator, output_folder)
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
|
-
|
|
6
|
-
from context_aware_translation.core.cancellation import raise_if_cancelled
|
|
7
|
-
from context_aware_translation.documents.galgame import deserialize_translation_unit_stream
|
|
8
|
-
from context_aware_translation.storage.schema.book_db import ChunkRecord
|
|
9
|
-
from context_aware_translation.utils.hashing import compute_chunk_hash
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
from context_aware_translation.core.context_manager import TranslationContextManager
|
|
13
|
-
from context_aware_translation.core.progress import ProgressCallback
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class GalgameDocumentHandler:
|
|
17
|
-
"""DocumentTypeHandler for unit-preserving galgame translation."""
|
|
18
|
-
|
|
19
|
-
def __init__(
|
|
20
|
-
self,
|
|
21
|
-
*,
|
|
22
|
-
concurrency: int = 5,
|
|
23
|
-
batch_size: int = 0,
|
|
24
|
-
max_tokens_per_batch: int = 2000,
|
|
25
|
-
) -> None:
|
|
26
|
-
self._concurrency = max(1, concurrency)
|
|
27
|
-
self._batch_size = batch_size
|
|
28
|
-
self._max_tokens_per_batch = max(1, max_tokens_per_batch)
|
|
29
|
-
|
|
30
|
-
def add_text(
|
|
31
|
-
self,
|
|
32
|
-
text: str,
|
|
33
|
-
max_token_size_per_chunk: int, # noqa: ARG002
|
|
34
|
-
document_id: int,
|
|
35
|
-
manager: TranslationContextManager,
|
|
36
|
-
) -> int:
|
|
37
|
-
"""Store one chunk per translation unit without deduping repeated dialogue text."""
|
|
38
|
-
units = deserialize_translation_unit_stream(text)
|
|
39
|
-
chunk_records: list[ChunkRecord] = []
|
|
40
|
-
chunk_id = manager.term_repo.get_next_chunk_id()
|
|
41
|
-
for unit in units:
|
|
42
|
-
if not unit.text.strip():
|
|
43
|
-
continue
|
|
44
|
-
identity_text = f"{unit.relative_path}\0{unit.unit_id}\0{unit.text}"
|
|
45
|
-
chunk_records.append(
|
|
46
|
-
ChunkRecord(
|
|
47
|
-
chunk_id=chunk_id,
|
|
48
|
-
hash=compute_chunk_hash(identity_text, document_id=document_id),
|
|
49
|
-
text=unit.text,
|
|
50
|
-
document_id=document_id,
|
|
51
|
-
is_extracted=False,
|
|
52
|
-
is_summarized=False,
|
|
53
|
-
)
|
|
54
|
-
)
|
|
55
|
-
chunk_id += 1
|
|
56
|
-
|
|
57
|
-
new_chunk_records = [
|
|
58
|
-
chunk_record for chunk_record in chunk_records if not manager.term_repo.chunk_exists_by_hash(chunk_record.hash)
|
|
59
|
-
]
|
|
60
|
-
if new_chunk_records:
|
|
61
|
-
manager._state_update([], new_chunk_records)
|
|
62
|
-
return chunk_id - 1
|
|
63
|
-
|
|
64
|
-
async def translate_chunks(
|
|
65
|
-
self,
|
|
66
|
-
document_ids: list[int],
|
|
67
|
-
manager: TranslationContextManager,
|
|
68
|
-
force: bool = False,
|
|
69
|
-
source_ids: list[int] | None = None,
|
|
70
|
-
cancel_check: Callable[[], bool] | None = None,
|
|
71
|
-
progress_callback: ProgressCallback | None = None,
|
|
72
|
-
) -> None:
|
|
73
|
-
"""Delegate to the generic text translator while preserving one chunk per unit."""
|
|
74
|
-
_ = source_ids
|
|
75
|
-
raise_if_cancelled(cancel_check)
|
|
76
|
-
await manager.translate_chunks(
|
|
77
|
-
concurrency=self._concurrency,
|
|
78
|
-
batch_size=self._batch_size,
|
|
79
|
-
max_tokens_per_batch=self._max_tokens_per_batch,
|
|
80
|
-
document_ids=document_ids,
|
|
81
|
-
force=force,
|
|
82
|
-
cancel_check=cancel_check,
|
|
83
|
-
progress_callback=progress_callback,
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
def get_translated_lines(
|
|
87
|
-
self,
|
|
88
|
-
document_id: int,
|
|
89
|
-
manager: TranslationContextManager,
|
|
90
|
-
) -> list[str]:
|
|
91
|
-
"""Return one translated entry per galgame translation unit."""
|
|
92
|
-
chunks = manager.term_repo.list_chunks(document_id=document_id)
|
|
93
|
-
if not chunks:
|
|
94
|
-
raise ValueError("No chunks found in the database")
|
|
95
|
-
|
|
96
|
-
sorted_chunks = sorted(chunks, key=lambda chunk: chunk.chunk_id)
|
|
97
|
-
untranslated = [chunk for chunk in sorted_chunks if not chunk.is_translated or chunk.translation is None]
|
|
98
|
-
if untranslated:
|
|
99
|
-
untranslated_ids = [chunk.chunk_id for chunk in untranslated]
|
|
100
|
-
raise ValueError(f"Cannot export: chunks {untranslated_ids} are not translated yet")
|
|
101
|
-
return [chunk.translation for chunk in sorted_chunks if chunk.translation is not None]
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from context_aware_translation.core.galgame_document_handler import GalgameDocumentHandler
|
|
4
|
-
from context_aware_translation.documents.galgame import TranslationUnit, serialize_translation_units
|
|
5
|
-
from context_aware_translation.storage.schema.book_db import ChunkRecord, TranslationChunkRecord
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class DummyTermRepo:
|
|
9
|
-
def __init__(self, chunks: list[ChunkRecord] | None = None) -> None:
|
|
10
|
-
self._chunks = chunks or []
|
|
11
|
-
|
|
12
|
-
def get_next_chunk_id(self) -> int:
|
|
13
|
-
return max((chunk.chunk_id for chunk in self._chunks), default=-1) + 1
|
|
14
|
-
|
|
15
|
-
def chunk_exists_by_hash(self, chunk_hash: str) -> int | None:
|
|
16
|
-
for chunk in self._chunks:
|
|
17
|
-
if chunk.hash == chunk_hash:
|
|
18
|
-
return chunk.chunk_id
|
|
19
|
-
return None
|
|
20
|
-
|
|
21
|
-
def list_chunks(self, document_id: int | None = None) -> list[ChunkRecord]:
|
|
22
|
-
if document_id is None:
|
|
23
|
-
return list(self._chunks)
|
|
24
|
-
return [chunk for chunk in self._chunks if chunk.document_id == document_id]
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class DummyManager:
|
|
28
|
-
def __init__(self, chunks: list[ChunkRecord] | None = None) -> None:
|
|
29
|
-
self.term_repo = DummyTermRepo(chunks)
|
|
30
|
-
self.translate_calls: list[dict[str, object]] = []
|
|
31
|
-
|
|
32
|
-
def _state_update(self, extracted_keyed_context, chunk_records): # noqa: ANN001, ARG002
|
|
33
|
-
self.term_repo._chunks.extend(chunk_records)
|
|
34
|
-
|
|
35
|
-
async def translate_chunks(self, **kwargs): # noqa: ANN003
|
|
36
|
-
self.translate_calls.append(kwargs)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def test_galgame_handler_add_text_preserves_repeated_dialogue_units() -> None:
|
|
40
|
-
manager = DummyManager()
|
|
41
|
-
handler = GalgameDocumentHandler()
|
|
42
|
-
text = serialize_translation_units(
|
|
43
|
-
[
|
|
44
|
-
TranslationUnit(relative_path="script.json", unit_id="0", text="はい"),
|
|
45
|
-
TranslationUnit(relative_path="script.json", unit_id="1", text="はい"),
|
|
46
|
-
]
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
last_chunk_id = handler.add_text(text, 100, 7, manager)
|
|
50
|
-
|
|
51
|
-
chunks = manager.term_repo.list_chunks(document_id=7)
|
|
52
|
-
assert last_chunk_id == 1
|
|
53
|
-
assert [chunk.text for chunk in chunks] == ["はい", "はい"]
|
|
54
|
-
assert chunks[0].hash != chunks[1].hash
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def test_galgame_handler_get_translated_lines_preserves_multiline_units() -> None:
|
|
58
|
-
chunks: list[ChunkRecord] = [
|
|
59
|
-
TranslationChunkRecord(
|
|
60
|
-
chunk_id=0,
|
|
61
|
-
hash="h0",
|
|
62
|
-
text="a",
|
|
63
|
-
document_id=7,
|
|
64
|
-
is_translated=True,
|
|
65
|
-
translation="第一行\n第二行",
|
|
66
|
-
),
|
|
67
|
-
TranslationChunkRecord(
|
|
68
|
-
chunk_id=1,
|
|
69
|
-
hash="h1",
|
|
70
|
-
text="b",
|
|
71
|
-
document_id=7,
|
|
72
|
-
is_translated=True,
|
|
73
|
-
translation="第三行",
|
|
74
|
-
),
|
|
75
|
-
]
|
|
76
|
-
manager = DummyManager(chunks)
|
|
77
|
-
handler = GalgameDocumentHandler()
|
|
78
|
-
|
|
79
|
-
assert handler.get_translated_lines(7, manager) == ["第一行\n第二行", "第三行"]
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
async def test_galgame_handler_delegates_translation_with_configured_batching() -> None:
|
|
83
|
-
manager = DummyManager()
|
|
84
|
-
handler = GalgameDocumentHandler(concurrency=3, batch_size=0, max_tokens_per_batch=1234)
|
|
85
|
-
|
|
86
|
-
await handler.translate_chunks([7], manager, force=True)
|
|
87
|
-
|
|
88
|
-
assert manager.translate_calls == [
|
|
89
|
-
{
|
|
90
|
-
"concurrency": 3,
|
|
91
|
-
"batch_size": 0,
|
|
92
|
-
"max_tokens_per_batch": 1234,
|
|
93
|
-
"document_ids": [7],
|
|
94
|
-
"force": True,
|
|
95
|
-
"cancel_check": None,
|
|
96
|
-
"progress_callback": None,
|
|
97
|
-
}
|
|
98
|
-
]
|
|
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
|
{contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/files/__init__.py
RENAMED
|
File without changes
|
{contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/files/glossary_io.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/task_engine.py
RENAMED
|
File without changes
|
{contextweave-0.3.0 → contextweave-0.3.1}/context_aware_translation/adapters/qt/workers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|