feat: 添加 OCR 词汇提取功能

新增 OCR 页面,用户可上传教材词汇表截图,使用 GLM-4.6V 视觉模型
提取单词-释义对并保存到指定文件夹。

- AI 管道: src/lib/bigmodel/ocr/ (orchestrator, types)
- 后端模块: src/modules/ocr/ (action-service-repository 架构)
- 前端页面: src/app/(features)/ocr/ (拖拽上传、folder 选择)
- i18n: 8 种语言翻译支持
This commit is contained in:
2026-03-10 15:21:45 +08:00
parent 683a4104ec
commit 9b78fd5215
18 changed files with 868 additions and 0 deletions

View File

@@ -197,6 +197,35 @@
"favorites": "お気に入り",
"settings": "設定"
},
"ocr": {
"title": "OCR語彙抽出",
"description": "教科書の語彙表のスクリーンショットをアップロードして単語と定義のペアを抽出",
"uploadImage": "画像をアップロード",
"dragDropHint": "ここに画像をドラッグ&ドロップ、またはクリックして選択",
"supportedFormats": "対応形式JPG、PNG、WebP",
"selectFolder": "フォルダを選択",
"chooseFolder": "抽出したペアを保存するフォルダを選択",
"noFolders": "フォルダがありません。まずフォルダを作成してください。",
"languageHints": "言語ヒント(オプション)",
"sourceLanguageHint": "ソース言語(例:英語)",
"targetLanguageHint": "ターゲット/翻訳言語(例:中国語)",
"process": "画像を処理",
"processing": "処理中...",
"preview": "プレビュー",
"extractedPairs": "抽出されたペア",
"word": "単語",
"definition": "定義",
"pairsCount": "{count} ペアを抽出",
"savePairs": "フォルダに保存",
"saving": "保存中...",
"saved": "{count} ペアを {folder} に保存しました",
"saveFailed": "保存に失敗しました",
"noImage": "先に画像をアップロードしてください",
"noFolder": "フォルダを選択してください",
"processingFailed": "OCR処理に失敗しました",
"tryAgain": "より鮮明な画像でお試しください",
"detectedLanguages": "検出:{source} → {target}"
},
"profile": {
"myProfile": "マイプロフィール",
"email": "メール: {email}",