feat: output_language=ja のとき日本語のドメインフォルダ名を自動選択 - #39
Closed
yoshiaki-sakae wants to merge 7 commits into
Closed
yoshiaki-sakae wants to merge 7 commits into
yoshiaki-sakae wants to merge 7 commits into
Conversation
出力言語を中国語から日本語へローカライズ。必須セクション名・図表決定・ lint検証・SKILL.md・references・ドメインラベルを日本語化。実論文(arXiv:2608.23565)で end-to-end生成とlint全ゲート通過を確認済み。中国語ソース論文の解析用エイリアスは保持。
description内の「Japanese triggers: 」のコロン+空白がフロントマターの プレーンスカラー解析を壊し、skills CLIがdeeppapernoteをスキップしていた。
言語依存文字列(セクション名/フィールド名/小見出し/品質ヒューリスティック/出力言語コード)を
scripts/locales/{zh,ja}.py に集約。contracts.py/lint_note.py/build_synthesis_bundle.py/
plan_figures.py はロケールから取得する薄い構造に変更。zhロケールは本家原文字列を忠実に保持し、
zhモードでcontractsは本家とビットレベル一致(コードのマージがクリーン)。
SKILL.md/references/common.pyドメインラベル/画像ステータス正規表現は日本語内容として維持(zh完全対応は今後)。
- localization: ja スキーマ(セクション名・基本情報フィールド・図表ラベル・機構フロー)と別名(ja / ja-JP / Japanese / 日本語)を追加 - user_configuration / run_pipeline / 各スクリプトの --language に ja を追加 - contracts: PAPER_TYPE_CONTRACTS_JA(5 論文タイプ)を追加 - plan_figures: 日本語の図表配置マップを追加 - lint_note: ja 向けに見出しプロファイルの厳格検査、簡体字残存ゲート(passes_style_gate)、 仮名を含む混在言語・文中改行判定、日本語トークン集合・状態正規表現を追加。 中国語向け機械翻訳痕跡チェックは zh-CN のみに限定 - common: ドメイン規則を DEEPPAPERNOTE_DOMAIN_RULES / ~/.deeppapernote/domain_rules.yaml で 上書き可能にし、既定フォルダ名も読み込んだ規則の alias から解決。<slug>.ja.md も論文フォルダ判定に含める - docs: output-language.md に日本語スキーマとスタイルゲートを追記、SKILL.md に日本語トリガー例を追加 - tests: tests/test_output_language_ja.py(23 件)
feat: upstream v2.3.0 を取り込み、日本語(ja)出力を新アーキテクチャ上で再実装
Obsidian へ保存する際のドメインフォルダ名が、日本語出力でも中国語 (机器学习・医疗健康 など)になっていた。原因は同梱の references/domain_rules.yaml が中国語ラベルのみで、フォルダ名解決の 経路(resolve_domain_subdir → infer_domain_label → load_domain_rules)が output_language を一切参照していなかったこと。 - references/domain_rules.ja.yaml を追加(alias/keyword は共通、ラベルのみ日本語化、未分類を明示) - resolve_domain_rules_path / load_domain_rules / infer_domain_label / domain_name_score に output_language を引き回し、 resolve_domain_subdir は config["output_language"] から言語を取得 - ENV・~/.deeppapernote/domain_rules.yaml の優先順位は従来どおり維持 - 同梱 YAML が読めない場合の既定ルールも DOMAIN_LABEL_TRANSLATIONS で日本語化 - 既存の Vault フォルダ再利用の挙動は言語に関係なく維持 - references/output-language.md の記述を更新 Co-Authored-By: Claude Code <noreply@anthropic.com>
Author
|
誤って fork の親リポジトリに作成してしまいました。この変更は fork(yoshiaki-sakae/DeepPaperNote)固有の日本語対応のため、こちらはクローズします。失礼しました。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
日本語出力(
output_language=ja)で Obsidian に保存した際、ドメインフォルダ名が中国語(机器学习・医疗健康など)になる問題を修正します。根本原因
フォルダ名の解決経路
resolve_domain_subdir→infer_domain_label→load_domain_rulesがoutput_languageを一切参照しておらず、同梱のreferences/domain_rules.yamlが中国語ラベルのみだったため。Vault に既存フォルダがあれば再利用されるので「常に」ではなく「多い」という報告と整合します。変更内容
references/domain_rules.ja.yamlを追加(alias/keyword は zh-CN と共通、ラベルのみ日本語化、未分類を明示)resolve_domain_rules_path/load_domain_rules/infer_domain_label/domain_name_scoreにoutput_languageを引き回し、resolve_domain_subdirはconfig["output_language"]から取得DEEPPAPERNOTE_DOMAIN_RULES→~/.deeppapernote/domain_rules.yaml→ 言語別同梱ファイル → 既定DOMAIN_LABEL_TRANSLATIONSで日本語化references/output-language.mdを更新テスト計画
tests/test_output_language_ja.py,tests/test_common.py,tests/test_output_language.py計 140 件通過ja指定時に機械学習/等のフォルダが作成されることを手動確認備考
以下は main でも同様に失敗する既存の Windows 固有問題で、本 PR の範囲外です:
test_windows_path_encoding.pyの 3 件、test_first_use_requests_one_workspace_prompt_batch、test_write_obsidian_note_reports_lint_warning_details、test_english_local_pdf_pipeline_lints_and_formally_saves_note_with_images_dir🤖 Generated with Claude Code