# GoldenDictOCR ——给GoldenDict添加OCR取词和鼠标取词功能

**URL:** <https://forum.freemdict.com/t/topic/9311>\
**Category:** 软件经验交流展望\
**Tags:** opensource, ocr, goldendict, 鼠标取词, ⭐star\
**Created:** [2021 年11 月 14 日 11:48 UTC](https://forum.freemdict.com/t/topic/9311 "2021-11-14T11:48:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 14 日 11:48 UTC](https://forum.freemdict.com/t/topic/9311/1 "2021-11-14T11:48:56Z")

</div>

> **[GitHub - VimWei/GoldenDictOCR: 给GoldenDict等词典添加OCR取词和鼠标取词功能。](https://github.com/VimWei/GoldenDictOCR)**
>
> 给GoldenDict等词典添加OCR取词和鼠标取词功能。

## 特点

- 既可以使用OCR进行查词（特别是图片等难以选中文字的情形）
- 也可以鼠标选择查询（适合于文本可选择，特别是英文词组、难以自动分词的中文等情形）
- 自动启用、关闭相关软件（Capture2Text.exe，GdOcrTool.ahk等）
- 不同查词模式智能切换，且屏幕有提醒当前模式

## 安装和配置

1. 安装 GoldenDict、Capture2Text、AutoHotkey到任意位置
2. 解压GoldenDictOCR到任意位置
3. 在GdOcrTool.ahk中配置好GoldenDict和Capture2Text的安装地址
4. 配置Capture2Text：复制Capture2Text.ini到"%appdata%\Capture2Text"

## 使用方法

1. 双击打开GoldenDictOCR.ahk，随时准备响应（可以将其加入开机启动）
2. Ctrl + Alt + O：开启或关闭 OCR 取词
  - 开启之后，点选取词：ctrl + 右键
  - 开启之后，框选取词：ctrl + `

3. Ctrl + Alt + I：开启或关闭鼠标选择取词
  - 开启之后，鼠标拖拉选择或双击自动选择文字取词

## 查词大比拼

大家试一试如何才能不更改配置即实现多种情形的查询：

- [Apple Store Online - Apple](https://www.apple.com/shop/gifts)  
这个案例页面，文字有大有小、有图片有文字，通常工具查询有难度

但在这里so easy!

![](https://forumcdn.freemdict.com/uploads/default/original/3X/e/1/e10d268bf0dd18309c95386658520db9163321f7.gif)

## Acknowledge

- Thanks Johnny\_Van for your GdOcrTool.ahk！ [【GdOcrTool】即指即译，OCR取词工具](https://forum.freemdict.com/t/topic/7166)
- Thanks Capture2Text [http://capture2text.sourceforge.net/](http://capture2text.sourceforge.net/)

## LICENSE

- [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)

---

<div class="post-metadata">

作者： ![medp7060](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8edcca/32.png) [@medp7060](https://forum.freemdict.com/u/medp7060)\
发布日期： [2021 年11 月 14 日 12:13 UTC](https://forum.freemdict.com/t/topic/9311/2 "2021-11-14T12:13:07Z")

</div>

Thanks, but it does not work at all. @Johnny_Van’s original AHK (described in the link below) works very well.

# [GoldenDict 官方版 OCR 功能增强](https://forum.freemdict.com/t/topic/7166)

---

<div class="post-metadata">

作者： ![artour](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/artour/32/7647_2.png) [@artour](https://forum.freemdict.com/u/artour)\
发布日期： [2021 年11 月 14 日 12:16 UTC](https://forum.freemdict.com/t/topic/9311/3 "2021-11-14T12:16:01Z")

</div>

me too. 不仅不能正常工作，还出现起奇怪该的现象，鼠标不按键，仅仅滑动就自动选择当前网页内容，而且不能取消和终止，被迫只能到任务管理器终止相关程序。  
不如开机自动启动 @Johnny_Van’s original AHK和Capture2Text.exe好过了。  
都在忙OCR取词，可实际上OCR取词能用上的时候有多少机会，现在大多数都是文字版的包括网页文字，软件的屏幕取词已经够用了，个别图片上的难取之词，手工查词也费不了多少功夫，还是想想，怎么更新下GoldenDict本身吧。

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 14 日 14:27 UTC](https://forum.freemdict.com/t/topic/9311/6 "2021-11-14T14:27:44Z")

</div>

升级-强烈建议：

1、升级GdOcrTool.ahk，建议大家随时去这里看看最新版，覆盖到这里即可。

> [@【GdOcrTool】即指即译，OCR取词工具](https://forum.freemdict.com/t/topic/7166/115):
>
> 改进版本已重新上传。改进内容：提示文件是否存在、程序是否运行；增加了超时设置，超时自动退出取词；esc 键强制退出框选；触发取词时才监听鼠标。鼠标不会像之前在异常条件下挂掉。

2、添加辨识性图标

PS：更多使用演示  
 ![GoldenDictOCR](https://forumcdn.freemdict.com/uploads/default/original/3X/b/b/bbbf3bef05a2251fc85ab93af41a00a56e53a4fe.gif)

---

<div class="post-metadata">

作者： ![youring](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/y/91b2a8/32.png) [@youring](https://forum.freemdict.com/u/youring)\
发布日期： [2021 年11 月 15 日 02:56 UTC](https://forum.freemdict.com/t/topic/9311/7 "2021-11-15T02:56:38Z")

</div>

用上了，谢谢Vim。值得一提的是capture2text的快捷键设置必须要Johnny\_Van贴图中设置相同。给没仔细看[这贴](https://forum.freemdict.com/t/topic/7166)的同学提个醒。

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 15 日 03:02 UTC](https://forum.freemdict.com/t/topic/9311/8 "2021-11-15T03:02:14Z")

</div>

GoldenDictOCR 只是为了更方便使用 GdOcrTool 而做的一点封装，并非为了取代 GdOcrTool 或任何其他软件，一切功劳都是属于 @Johnny_Van 。

我自己使用会纳入更加庞大的AHK库，从而随时调用。你们可以自由组合，比如简化为两个文件。

---

<div class="post-metadata">

作者： ![artour](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/artour/32/7647_2.png) [@artour](https://forum.freemdict.com/u/artour)\
发布日期： [2021 年11 月 15 日 07:23 UTC](https://forum.freemdict.com/t/topic/9311/9 "2021-11-15T07:23:57Z")

</div>

> [@Vim](#):
>
> 会纳入更加庞大的AHK库，从而随时调用。你们可以自由组合，比如简化为两个文件

Vim的更新文件都发到Github上，很难链接得上这个网站哦！  
功夫不负有心人，试了第四次，连接上Github，下载最新版，软件工作正常！搞定！感谢Vim的奉献！

---

<div class="post-metadata">

作者： ![artour](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/artour/32/7647_2.png) [@artour](https://forum.freemdict.com/u/artour)\
发布日期： [2021 年11 月 15 日 08:44 UTC](https://forum.freemdict.com/t/topic/9311/10 "2021-11-15T08:44:37Z")

</div>

反应一点显示的问题： Ctrl+Alt+I 关闭时，先显示”启用鼠标取词“，再显示”关闭鼠标取词“  
而 Ctrl+Alt+O 开启时，却先显示：”关闭鼠标取词“，再显示”启用鼠标取词“。

另外，在关闭状态下，Goldendict和GoldenDictOCR还在运行着，已检查windows右下角状态栏没有OCR其它程序运行。但是，在鼠标划选文字时（包括汉字字符），老是弹出词典的小窗口，又随即自动关闭，GoldenDict的历史记录里竟然记录了鼠标划选的文字。图示：  
 ![历史记录](https://forumcdn.freemdict.com/uploads/default/original/3X/1/c/1c23a83b2a0ee82b801baad8acf186eaed26a132.png)

这种现象非常影响正在进行的工作（比如发此贴时编辑状态被整得不见了，好在主站有继续编辑功能）。

请各位关注此问题！！！！！！

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 15 日 10:38 UTC](https://forum.freemdict.com/t/topic/9311/11 "2021-11-15T10:38:33Z")

</div>

你的阅读理解堪忧…请重新阅读三遍顶楼的“使用方法”（OCR取词 Vs. 鼠标\<选取\>取词），三遍还不行就十遍。

---

<div class="post-metadata">

作者： ![artour](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/artour/32/7647_2.png) [@artour](https://forum.freemdict.com/u/artour)\
发布日期： [2021 年11 月 15 日 10:53 UTC](https://forum.freemdict.com/t/topic/9311/12 "2021-11-15T10:53:19Z")

</div>

不到三遍，两遍就可以了。  
Vim的编程是真功夫！  
Ctrl + Alt + I：开启或关闭鼠标选取取词的原理是什么呢？ 调用GoldenDict的屏幕取词了吗？  
既然GoldenDict开源，@Vim，能不能直接在GoldenDict的工具栏再加个按钮，直接开启这OCR取词？这样就高大上了啊！

---

<div class="post-metadata">

作者： ![leonlaI2000](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@leonlaI2000](https://forum.freemdict.com/u/leonlaI2000)\
发布日期： [2021 年11 月 15 日 13:35 UTC](https://forum.freemdict.com/t/topic/9311/13 "2021-11-15T13:35:37Z")

</div>

太复杂了，不能整合一下吗？像nonwill做的一样？

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 15 日 16:40 UTC](https://forum.freemdict.com/t/topic/9311/14 "2021-11-15T16:40:44Z")

</div>

请出门右转，找 没希望

---

<div class="post-metadata">

作者： ![artour](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/artour/32/7647_2.png) [@artour](https://forum.freemdict.com/u/artour)\
发布日期： [2021 年11 月 16 日 08:28 UTC](https://forum.freemdict.com/t/topic/9311/15 "2021-11-16T08:28:10Z")

</div>

GoldenDict官方版（试了491，497等版本）在浏览[Oxford Advanced Learner’s Dictionary 10th Edition](https://forum.freemdict.com/t/topic/7038) 单词发音时，总是弹出错误消息！而MDict浏览发音时没有此问题。有没有人反馈给总部啊！

---

<div class="post-metadata">

作者： ![tsaowong](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/t/f08c70/32.png) [@tsaowong](https://forum.freemdict.com/u/tsaowong)\
发布日期： [2021 年11 月 16 日 15:46 UTC](https://forum.freemdict.com/t/topic/9311/16 "2021-11-16T15:46:35Z")

</div>

非常好用，感谢 @Vim 和 @Johnny_van 二位大佬

---

<div class="post-metadata">

作者： ![开心最重要](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/%E5%BC%80/8e7dd6/32.png) [@开心最重要](https://forum.freemdict.com/u/%E5%BC%80%E5%BF%83%E6%9C%80%E9%87%8D%E8%A6%81)\
发布日期： [2021 年11 月 17 日 01:57 UTC](https://forum.freemdict.com/t/topic/9311/17 "2021-11-17T01:57:04Z")

</div>

大佬，请问GD的词典栏里的词典图标可调整大小吗？想把词典图标调大一些，还有导航栏的字体可改变吗？

 ![Snipaste_2021-11-17_12-30-09](https://forumcdn.freemdict.com/uploads/default/original/3X/9/1/91affb7bc74aebcd20294521072e2a29beeaf032.png)  
【已解决】[Goldendict 真不错 - #34，来自 开心最重要](https://forum.freemdict.com/t/topic/9345/34)

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 19 日 01:29 UTC](https://forum.freemdict.com/t/topic/9311/18 "2021-11-19T01:29:32Z")

</div>

Update：提示信息更加友好一些。

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 21 日 02:24 UTC](https://forum.freemdict.com/t/topic/9311/19 "2021-11-21T02:24:39Z")

</div>

Perf: 框选时鼠标指针切换为十字架

---

<div class="post-metadata">

作者： ![artour](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/artour/32/7647_2.png) [@artour](https://forum.freemdict.com/u/artour)\
发布日期： [2021 年11 月 21 日 03:58 UTC](https://forum.freemdict.com/t/topic/9311/20 "2021-11-21T03:58:22Z")

</div>

No releases published？

---

<div class="post-metadata">

作者： ![sff34](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@sff34](https://forum.freemdict.com/u/sff34)\
发布日期： [2021 年11 月 22 日 14:51 UTC](https://forum.freemdict.com/t/topic/9311/21 "2021-11-22T14:51:56Z")

</div>

切换热键有些复杂了，Ctrl + Alt + O、Ctrl + Alt + I、ctrl + `可以在左Ctrl键、左Win键、左Alt键之间任意选取，热键可以有单击、双击、三击、短按释放和长按释放的区别，这三个热键有12种变形呢，够折腾的。

功能还是有些复杂了，其实，OCR最实用的是框选，点选就是纯英文很多时候往往也惨不忍睹；鼠标选取复制最可靠的还是选定后Ctrl+C+C，或者其简化的单热键形式，选取而非选定取，往往是时灵时不灵的。

不过作者的努力还是可贵的，功能越来越强，越来越可靠，在不少情况下，还是很有优势的。赞一个！

---

<div class="post-metadata">

作者： ![Vim](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/vim/32/8408_2.png) [@Vim](https://forum.freemdict.com/u/Vim)\
发布日期： [2021 年11 月 22 日 23:14 UTC](https://forum.freemdict.com/t/topic/9311/22 "2021-11-22T23:14:44Z")

</div>

> [@sff34](#):
>
> 切换热键有些复杂了，Ctrl + Alt + O、Ctrl + Alt + I、ctrl + `

确实有点复杂，但记住就方便了，否则得无数个鼠标点击操作。

之所以要这么复杂，是因为这些快捷键几乎是全局的，而我有更多重要的AHK功能需要占用更简单的快捷键（你若了解vim simulator，就知道键盘快捷键几乎都快不够用了）。

[下一页](https://forum.freemdict.com/t/topic/9311.md?page=2)
