{"id":13629452,"url":"https://github.com/ks233/ja-learner","last_synced_at":"2026-01-16T04:00:08.644Z","repository":{"id":214116358,"uuid":"648688285","full_name":"ks233/ja-learner","owner":"ks233","description":"📖简易日语学习 / 视觉小说阅读辅助工具","archived":false,"fork":false,"pushed_at":"2025-06-03T16:32:27.000Z","size":11123,"stargazers_count":747,"open_issues_count":11,"forks_count":36,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T22:16:29.112Z","etag":null,"topics":["galgame","japanese","language-learning","visual-novel"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ks233.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-02T14:57:43.000Z","updated_at":"2025-06-03T11:01:22.000Z","dependencies_parsed_at":"2024-03-10T08:27:18.635Z","dependency_job_id":"f4f6637c-42b9-439d-95ea-fb9651367cdd","html_url":"https://github.com/ks233/ja-learner","commit_stats":null,"previous_names":["ks233/ja-learner"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ks233/ja-learner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks233%2Fja-learner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks233%2Fja-learner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks233%2Fja-learner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks233%2Fja-learner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ks233","download_url":"https://codeload.github.com/ks233/ja-learner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks233%2Fja-learner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["galgame","japanese","language-learning","visual-novel"],"created_at":"2024-08-01T22:01:11.086Z","updated_at":"2026-01-16T04:00:08.600Z","avatar_url":"https://github.com/ks233.png","language":"C#","funding_links":[],"categories":["C#"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eKS的日语学习工具 v0.4\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cstrong\u003e📖 简易日语学习 / 视觉小说阅读辅助工具\u003c/strong\u003e\n    \u003cbr /\u003e\n    \u003cspan\u003e句子拆解 • 汉字注音 • 一键查词 • 参考翻译 • 外来语标注 • AI讲解\u003c/span\u003e\n\u003c/div\u003e \n\u003ch3 align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ks233/ja-learner/releases\"\u003e下载\u003c/a\u003e\u003cspan\u003e • \u003c/span\u003e\u003ca href=\"https://github.com/ks233/ja-learner/issues\"\u003eBug 反馈\u003c/a\u003e\n\u003c/h3\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ks233/ja-learner\"\u003e\n        \u003cimg src=\"README/title.png\" alt=\"Title\" \u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## 功能介绍\n\n* **语句分析**：用不同样式区分句子成分，为句子中的汉字注音\n* **单词查询**：点击单词一键查询 MOJi 辞書，哪里不会点哪里\n* **参考翻译**：支持谷歌翻译与 AI 翻译，把握句子整体含义\n* **片假不留**：在片假名上方显示英语翻译，满屏片假名也不怕\n* **游戏文本分析**：吸附并跟随游戏窗口，配合文本提取工具，实时分析游戏文本\n* **AI 讲解**：调用 AI 讲解句子中的单词和语法成分\n* **添加 Anki 卡片**：快速添加单词卡片，打造自己的单词本\n\n## 使用说明\n\n### 分析与查词\n\n* 读取剪贴板或手动输入句子\n* 勾选“片假不留”把片假名单词翻译成英文\n  * 点击片假名单词上方的英文可以隐藏该单词的翻译，再点一下恢复显示，用于屏蔽错误的翻译结果\n* 可以用 Ctrl + 滚轮调整分析界面的显示大小\n  * 本质浏览器套壳，你甚至可以按 F12 打开控制台（\n* 在语句分析界面点击单词快速查词\n  * 左键点击单词：在词典窗口中显示 MOJi 辞書的搜索结果\n  * 中键点击单词：在浏览器中打开单词在 MOJi 辞書的搜索页面\n  * SHIFT + 左键点击单词：在搜索内容末尾追加单词\n* 词典窗口手动搜索\n  * 双击搜索框清空搜索内容\n  * 点击链接跳转至对应的词典网站\n\n![demo](README/demo.gif)\n\n### 窗口吸附\n\n在主窗口的“系统设置”面板中，首先点击“选择窗口”按钮，然后把鼠标移到想要吸附的窗口，点一下左键。此时右边选框中的文字会变成“与 xxx 对齐”，把选框勾上，窗口就吸附到游戏窗口边上了。\n\n![attach](README/attach.gif)\n\n### 游戏文本提取\n\n本项目**并没有**内置游戏文本提取的功能，但是可以实时读取剪贴板。建议使用 [Textractor](https://github.com/Artikash/Textractor)、[manga-ocr](https://github.com/kha-white/manga-ocr) 等文本提取工具将游戏文本提取至剪贴板，然后在本软件中勾选“读取剪贴板”，即可实时同步游戏文本。配合 Textractor 的使用效果如图：\n\n![text-extraction](README/text-extraction.gif)\n\n### 参考翻译\n\n目前支持了谷歌翻译和 GPT 翻译。其中“谷歌翻译”无需配置，可以免费无限制使用，而 GPT 需要配置 API Key，消耗 API 余额。\n\n#### 谷歌翻译 \u0026 谷歌生草机\n\n这是两个不同的接口，“谷歌翻译”会得到与网页版谷歌翻译相同的翻译结果，但不是正规 API，以后可能会失效。\n\n“谷歌生草机”的翻译结果与网页版不同，质量普遍低于网页版。\n\n\u003e 如果你的网络环境无法访问谷歌翻译，可以尝试使用 [GoodCoder666/GoogleTranslate_IPFinder](https://github.com/GoodCoder666/GoogleTranslate_IPFinder) 等工具扫描可用 IP，然后修改 HOST。\n\n#### 使用 GPT（需要 API Key）\n\n在 `appsettings.json` 中配置 GPT 相关字段：\n\n```js\n\"GPT\": {\n    \"ApiKey\": \"sk-xxx\",\n    \"ApiUrl\": \"https://api.openai.com/v1\", // 实际调用为 https://api.openai.com/v1/chat/completions\n    \"Model\": \"gpt-4o-mini\", // 兼容 OpenAI API 的模型\n    \"ExtraPromptDir\": \"extra_prompts\", // 额外的 Prompt，比如指定某些角色名字怎么翻译\n    \"TranslatePrompt\": \"...\", // 翻译 Prompt\n    \"ExplainPrompt\": \"...\" // 分析 Prompt\n}\n```\n\n除了 ChatGPT，也支持其它兼容 OpenAI API 的模型，比如 Ollama、Deepseek 等。\n\nOllama：\n\n```js\n    \"ApiKey\": \"whatever\",\n    \"ApiUrl\": \"http://localhost:11434/v1\",\n    \"Model\": \"qwen2.5:3b\",\n```\n\nDeepseek：\n\n```js\n    \"ApiKey\": \"sk-xxx\",\n    \"ApiUrl\": \"https://api.deepseek.com/v1\", \n    \"Model\": \"deepseek-chat\",\n```\n\n如果对默认的 Prompt 不满意也可以自行更改，配置好 ApiKey 就可以使用 AI 翻译和解说文本了。\n\n![gpt](README/gpt.gif)\n\n### 沉浸模式\n\n- 双击分析页面的背景，进入仅显示语句分析的沉浸模式\n- CTRL + 左键拖动窗口\n- 左键拖动窗口边缘调整窗口大小\n\n![immersive](README/immersive.gif)\n\n### 添加 Anki 卡片（测试功能，默认关闭）\n\nAnki 是一款经典的记忆卡片软件，它的设计理念影响了很多背单词软件。如果你不了解 Anki，可以看这个[简短的介绍视频](https://www.bilibili.com/video/BV1hz4y1U7H3/)。\n\n在 `appsettings.json` 中，与 Anki 有关的字段有以下这些：\n\n```js\n\"AnkiEnabled\": true,\n\"Anki\": {\n    \"AnkiConnectUrl\": \"http://127.0.0.1:8765\", // AnkiConnect 默认端口\n    \"Deck\": \"test\",            // 添加卡片的目标牌组\n    \"Model\": \"ja-learner\",        // 卡片的模板名\n    \"FieldNames\":{            // 模板中的字段\n        \"Word\": \"单词\",            // 存储单词的字段名\n        \"Example\": \"例句\",        // 存储例句的字段名\n        \"Explain\": \"解释\"        // 存储解释的字段名\n    }\n}\n```\n\n使用 Anki 的准备工作如下：\n\n- `AnkiEnabled` 默认为 false，改为 true 以显示与 Anki 有关的界面。\n- 安装 Anki，为了使软件能连接 Anki，安装 [AnkiConnect](https://ankiweb.net/shared/info/2055492159) 插件，插件默认端口是 8765。\n- 准备一个牌组，新建牌组或者使用现有的牌组都行。\n- 在 Anki 中创建新的卡牌模板\n  - 用三个字段分别存放单词、例句、解释。\n  - 编辑卡牌模板的显示方式，比如把单词和例句显示在正面，解释显示在背面\n- 将 `Deck` 以及下面的几项修改为对应的牌组名称、模板名称、字段名称。\n  - 注意核对牌组与字段名称，如果牌组/模板/字段不存在，或者名称不一致，将无法添加卡片。\n\n完成配置后只要在词典页面点击“添加到Anki”，就可以一键将当前文本例句、MOJi 单词和解释创建为新卡片，添加到卡组中。\n\n自动导入的单词卡片如图所示：\n\n![anki](README/anki.png)\n\n## 使用建议\n\n本项目的分词与注音功能基于 MeCab，虽然整体准确率还算可以，但有时会犯一些低级错误，比如在某些语境下把\u003cruby\u003e身体\u003crt\u003eからだ\u003c/rt\u003e\u003c/ruby\u003e注音为 しんたい、把\u003cruby\u003e二人\u003crt\u003eふたり\u003c/rt\u003e\u003c/ruby\u003e注音为 ににん，遇到读音特殊的人名也无法正确注音。用词汇更丰富的 [UniDic](https://clrd.ninjal.ac.jp/unidic/) 词典替换 `dic` 文件夹中默认的 IPADIC 效果会稍好一些。\n\n翻译毕竟都是机翻，准确率有限。谷歌翻译日译中会用英语作为中间语言，有时候结果很怪；ChatGPT 比谷歌懂更多俗语、流行语，但比较不稳定，偶尔会使用简体中文以外的语言回复、唐突地使用[塞氏翻译法](https://zh.moegirl.org.cn/zh-hans/塞氏翻译法)。建议把本软件当做一个精读工具而不是翻译器，把注意力放在日语原文上，只在不确定的时候使用翻译作为参考。\n\n外来语标注功能使用谷歌翻译将片假名单词翻译为英语，但不是所有片假名单词都是外来语，外来语也不一定来源于英语，还有像 supplies 和 surprise 这样的“同音词”也不好区分，因此也会出现标注错误的情况。\n\n根据作者自己的使用体验，整体准确率还可以接受，但还是不建议完全初学者使用，以免被误导。如果遇到可疑的注音或翻译，建议查询更权威的词典，比如 [Weblio 辞書](https://www.weblio.jp/)、大辞林、小学馆日中，网络用语可以查 [ニコニコ大百科](https://dic.nicovideo.jp/)。\n\n## 相关项目\n\n开坑的想法主要来源于 [YUKI 翻译器](https://github.com/project-yuki/YUKI) 和 [Translation-Aggregator](https://github.com/Translation-Aggregator/Translation-Aggregator)，前者支持了丰富的翻译接口，内置了文本提取功能，但使用起来比较复杂，且缺少快速查词的功能；后者虽然可以鼠标悬停查词，但只有日英词典、界面比较古老，而且翻译接口几乎炸完了，于是我决定搓一个更简单、更符合自己需求的工具。\n\nv0.4 更新了添加 Anki 卡片的功能，想法来源于 [2DIPW/novel2anki](https://github.com/2DIPW/novel2anki) 和 [Yomichan](https://foosoft.net/projects/yomichan/)。novel2anki 可以用视觉小说解包文件生成精美的带例句、语音的 Anki 卡片，Yomichan 作为经典好用的日语学习工具也能与 Anki 联动快速添加卡片。为了适应自己的工作流，我在本项目中加入了类似的 Anki 功能。Yomichan 作者开发的 [AnkiConnect](https://ankiweb.net/shared/info/2055492159) 插件使此功能得以实现，感恩大佬。\n\n使用的第三方工具与参考资料：\n\n* 形态分析：[taku910/mecab](https://github.com/taku910/mecab) 的 .Net 移植版本 [kekyo/MeCab.DotNet](https://github.com/kekyo/MeCab.DotNet)\n* ChatGPT：[openai/openai-dotnet](https://github.com/openai/openai-dotnet)\n* [前端页面](https://github.com/ks233/ja-learner-webview)：[WebView2 控件](https://www.nuget.org/packages/Microsoft.Web.WebView2)，Vite + Vue\n* 单词搜索：[MOJi 辞書](https://www.mojidict.com/)\n* 谷歌翻译：参考了 [FilipePS/Traduzir-paginas-web](https://github.com/FilipePS/Traduzir-paginas-web) 的 API 调用方式\n* Anki：[AnkiConnect](https://ankiweb.net/shared/info/2055492159)\n* 其它参考资源：[taishi-i/awesome-japanese-nlp-resources](https://github.com/taishi-i/awesome-japanese-nlp-resources)\n\n## 作者的其它项目\n\n两个开箱即用的网页小工具，都直接部署在 github.io 上，有兴趣的也可以试试看。\n\n- [ks233/video-annotator: ▶️ 纯前端实现，轻便实用的本地视频笔记 / 游戏录像复盘 / 影视音乐分析工具](https://github.com/ks233/video-annotator)\n- [ks233/color-study-tool: 一个巨简陋的网页端色彩收集器，用于研究色彩组合的 HSV 规律。](https://github.com/ks233/color-study-tool)\n\n## 贡献者\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n\n\u003c!-- markdownlint-disable --\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://ks233.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/38981529?v=4?s=100\" width=\"100px;\" alt=\"ks233\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eks233\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-ks233\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/shaka0919\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/17539962?v=4?s=100\" width=\"100px;\" alt=\"Harvey Wang\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHarvey Wang\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-shaka0919\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://lgbt.sh\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/38471793?v=4?s=100\" width=\"100px;\" alt=\"Mikka\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMikka\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-cvyl\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fks233%2Fja-learner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fks233%2Fja-learner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fks233%2Fja-learner/lists"}