Normalize Chinese Part ordinals and support resumable complete-book translation

This commit is contained in:
Kai Tan
2026-10-08 08:32:05 +08:00
parent 498b5d09ce
commit 644e93b874
12 changed files with 186 additions and 20 deletions
+12
View File
@@ -34,6 +34,18 @@ cp .env.example .env
## 可重复 QA
完整翻译使用 `--complete-book`,会纳入默认跳过的尾注、参考文献、索引、版权页及非 spine 文字资源。图片中的文字仍作为原图保留。NAV、NCX 和书内目录继续复用实际章节标题译文。
Zenmux 的 Sonnet 5.5 配置见 `config/zenmux.yaml`。凭据使用本地 `ZENMUX_API_KEY`,或通过 `--env-file` 指定 dotenv 文件;不把密钥写入 YAML 或提交到 Git。已有 Anthropic 兼容接口的 Zenmux token 可在本地映射到此变量:
```bash
export ZENMUX_API_KEY="$ANTHROPIC_AUTH_TOKEN"
.venv/bin/python main.py 'input/Gambling Man.epub' --complete-book --bilingual \
--config config/zenmux.yaml --output-dir output/sonnet55
```
`--config` 指定独立配置,不需要修改默认模型。全书术语扫描逐批保存;中断后运行相同命令会恢复扫描及已验证译文。自动术语冲突记录在 glossary.json 的 conflicts 中,并保留已有译名,仍需语言复核。
```bash
.venv/bin/pip install -r requirements-dev.txt
.venv/bin/python -m pytest -q