# 查字典的一个思路，用filelocator全文检索文本化的字典

**URL:** <https://forum.freemdict.com/t/topic/2045>\
**Category:** 软件经验交流展望\
**Created:** [2020 年5 月 23 日 01:55 UTC](https://forum.freemdict.com/t/topic/2045 "2020-05-23T01:55:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

作者： ![ariosto](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/ariosto/32/39_2.png) [@ariosto](https://forum.freemdict.com/u/ariosto)\
发布日期： [2020 年5 月 23 日 01:55 UTC](https://forum.freemdict.com/t/topic/2045/1 "2020-05-23T01:55:01Z")

</div>

在豆瓣看到有人发一个[语法的问题](https://github.com/mahavivo/logical-grammar/blob/master/%E8%8B%B1%E8%AF%AD%E9%80%BB%E8%BE%91%E8%AF%AD%E6%B3%95%E8%A6%81%E7%95%A5.md)

顺藤看到了一些[文本化的字典](https://github.com/mahavivo/english-dictionary)

下载后用了emedit看了下，想到我以前用过的filelocator（我用的是官方lite版）  
基本可以达到秒级，除了发音没什么毛病  
来两张图

 ![截图_202005230905400SS](https://forumcdn.freemdict.com/uploads/default/original/2X/1/1ea0b792681485f437cfffafc3daa967d32aae25.png) ![截图_202005230965306SS](https://forumcdn.freemdict.com/uploads/default/original/2X/f/f481eb7312d3bf18c218788a494d68aecb8c119d.png)

---

<div class="post-metadata">

作者： ![nli](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/nli/32/18626_2.png) [@nli](https://forum.freemdict.com/u/nli)\
发布日期： [2020 年5 月 23 日 02:11 UTC](https://forum.freemdict.com/t/topic/2045/2 "2020-05-23T02:11:05Z")

</div>

查翻译的precedent/双语对照语料库有用，但字典的全文搜索，GoldenDict自带的全文索引就很好用。

---

<div class="post-metadata">

作者： ![ariosto](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/ariosto/32/39_2.png) [@ariosto](https://forum.freemdict.com/u/ariosto)\
发布日期： [2020 年5 月 23 日 02:15 UTC](https://forum.freemdict.com/t/topic/2045/3 "2020-05-23T02:15:05Z")

</div>

goldendict的全文需要建索引

---

<div class="post-metadata">

作者： ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
发布日期： [2020 年5 月 23 日 02:20 UTC](https://forum.freemdict.com/t/topic/2045/4 "2020-05-23T02:20:40Z")

</div>

emm这就没格式了。而且太杂乱了。当然，全文搜索也是好的。试试上G 的文本速度几何？

---

<div class="post-metadata">

作者： ![ariosto](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/ariosto/32/39_2.png) [@ariosto](https://forum.freemdict.com/u/ariosto)\
发布日期： [2020 年5 月 23 日 03:46 UTC](https://forum.freemdict.com/t/topic/2045/5 "2020-05-23T03:46:50Z")

</div>

文本化之后，估计没多少。

github上那位提供的文本化字典282M，包括重复的，5秒

突然觉得从截图上看，隔壁作反查的那位，跟这个很相似

---

<div class="post-metadata">

作者： ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
发布日期： [2020 年5 月 23 日 05:27 UTC](https://forum.freemdict.com/t/topic/2045/6 "2020-05-23T05:27:38Z")

</div>

> [@ariosto](#):
>
> 5秒

太长， filelocator是可以建立索引的。

---

<div class="post-metadata">

作者： ![qujinzhi](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/q/6de8d8/32.png) [@qujinzhi](https://forum.freemdict.com/u/qujinzhi)\
发布日期： [2020 年5 月 23 日 05:39 UTC](https://forum.freemdict.com/t/topic/2045/7 "2020-05-23T05:39:48Z")

</div>

第一次是2016年在知乎上面看见有人介绍这个方法，后来知道掌上百科上面有个人提出这个方法的时间更早。优点是比深蓝词典等的全文搜索更精准，正则表达式花样更多，缺点在于需要另行提取TXT。  
[https://www.pdawiki.com/forum/thread-20067-1-1.html](https://www.pdawiki.com/forum/thread-20067-1-1.html)  
[https://www.pdawiki.com/forum/thread-11546-1-1.html](https://www.pdawiki.com/forum/thread-11546-1-1.html)

> **[利用多个常用词典txt文件辅助汉英翻译学习 - 外语学习交流区 - Foreign Language Learning - 掌上百科 - PDAWIKI -...](https://www.pdawiki.com/forum/thread-20250-1-1.html)**
>
> 此方法作用：1、利用正则搜索反查中文对应的英文地道表达2、利用正则搜索检验某用法或翻译是否地道以及使用频率。此学习方法已早有大神无私分享。知乎大神 https://ww ... 利用多个常用词典txt文件辅助汉英翻译学习 ,掌上百科 - PDAWIKI

[https://www.pdawiki.com/forum/thread-18358-1-1.html](https://www.pdawiki.com/forum/thread-18358-1-1.html)  
[https://www.pdawiki.com/forum/thread-11741-1-1.html](https://www.pdawiki.com/forum/thread-11741-1-1.html)

---

<div class="post-metadata">

作者： ![ariosto](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/ariosto/32/39_2.png) [@ariosto](https://forum.freemdict.com/u/ariosto)\
发布日期： [2020 年5 月 23 日 07:48 UTC](https://forum.freemdict.com/t/topic/2045/8 "2020-05-23T07:48:23Z")

</div>

见笑，孤陋寡闻了。

看到人家做好的txt版字典，谢谢

---

<div class="post-metadata">

作者： ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
发布日期： [2020 年5 月 24 日 10:18 UTC](https://forum.freemdict.com/t/topic/2045/10 "2020-05-24T10:18:05Z")

</div>

多谢！以前用过两个小工具，可以用正则搜索文本，好像还能对比文件内容。回忆并搜索了一下，其中一个是search and replace，另一个与此类似，实在想不起来了。

---

<div class="post-metadata">

作者： ![Devil-Antivirus](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@Devil-Antivirus](https://forum.freemdict.com/u/Devil-Antivirus)\
发布日期： [2021 年11 月 19 日 14:38 UTC](https://forum.freemdict.com/t/topic/2045/11 "2021-11-19T14:38:33Z")

</div>

记得是知乎@Frank\_Huang写的一篇文章，现在被删了，微信公众号上还有存稿，作者还好心帮忙编译了大约10部常用词典(包括柯林斯、剑桥、朗文等)

---

<div class="post-metadata">

作者： ![dictionaryfan](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@dictionaryfan](https://forum.freemdict.com/u/dictionaryfan)\
发布日期： [2021 年11 月 20 日 01:04 UTC](https://forum.freemdict.com/t/topic/2045/12 "2021-11-20T01:04:38Z")

</div>

是可以的，就是没有格式  
更常见的场景是索引电子书，然后检索

---

<div class="post-metadata">

作者： ![qujinzhi](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/q/6de8d8/32.png) [@qujinzhi](https://forum.freemdict.com/u/qujinzhi)\
发布日期： [2021 年11 月 20 日 02:40 UTC](https://forum.freemdict.com/t/topic/2045/13 "2021-11-20T02:40:32Z")

</div>

我上面第一个链接，有一个叫取进止的人（就是我），就提到了你说的这个人：

 ![Screenshot_20211120103837](https://forumcdn.freemdict.com/uploads/default/original/3X/7/b/7b9acec30cf5e7d3609b91483504fce5cac05be4.jpeg)

---

<div class="post-metadata">

作者： ![Devil-Antivirus](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@Devil-Antivirus](https://forum.freemdict.com/u/Devil-Antivirus)\
发布日期： [2021 年11 月 20 日 11:14 UTC](https://forum.freemdict.com/t/topic/2045/14 "2021-11-20T11:14:32Z")

</div>

确实，以前有一次用的时候我就发现他分享的剑桥和柯林斯词典是反过来的

---

<div class="post-metadata">

作者： ![WalkingDictionary](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/w/41988e/32.png) [@WalkingDictionary](https://forum.freemdict.com/u/WalkingDictionary)\
发布日期： [2021 年11 月 20 日 13:18 UTC](https://forum.freemdict.com/t/topic/2045/15 "2021-11-20T13:18:06Z")

</div>

先不说速度，反查到需要的内容后，为了准确理解和使用，往往还需要跳转回原词典查看释义、例句等信息。用这个没法做到吧？

---

<div class="post-metadata">

作者： ![Devil-Antivirus](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@Devil-Antivirus](https://forum.freemdict.com/u/Devil-Antivirus)\
发布日期： [2021 年11 月 20 日 13:40 UTC](https://forum.freemdict.com/t/topic/2045/16 "2021-11-20T13:40:07Z")

</div>

当然可以做到了，对于词典作为数据库来说，反查出来的内容包括词典释义+例句，双击可以看到 (原词典中)对应词条的详情

---

<div class="post-metadata">

作者： ![smiling1384](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@smiling1384](https://forum.freemdict.com/u/smiling1384)\
发布日期： [2021 年11 月 21 日 04:02 UTC](https://forum.freemdict.com/t/topic/2045/17 "2021-11-21T04:02:45Z")

</div>

该方法特别适合例句检索，词组检索，搭配检索，也不是没用。起码省去了做词典的费劲事。我也是看了知乎的文章，用过一段时间。

---

<div class="post-metadata">

作者： ![dylan\_lee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/dylan_lee/32/18683_2.png) [@dylan\_lee](https://forum.freemdict.com/u/dylan_lee)\
发布日期： [2021 年11 月 21 日 07:54 UTC](https://forum.freemdict.com/t/topic/2045/18 "2021-11-21T07:54:03Z")

</div>

我用grep找几个文本字典就能搞定了。但用处真的不大。

> grep --color=always -ne “$@” \* |less -r

这是我用的命令， 把 $@ 替换成你要查找的词就可以啦。在控制台下运行，运行环境为windows的subsystem，mac直接运行。

---

<div class="post-metadata">

作者： ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
发布日期： [2021 年11 月 21 日 22:31 UTC](https://forum.freemdict.com/t/topic/2045/19 "2021-11-21T22:31:33Z")

</div>

> [@dylan\_lee](#):
>
> subsystem

这是什么？能不能说具体点

---

<div class="post-metadata">

作者： ![zky030600](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/z/ac91a4/32.png) [@zky030600](https://forum.freemdict.com/u/zky030600)\
发布日期： [2021 年11 月 22 日 04:14 UTC](https://forum.freemdict.com/t/topic/2045/20 "2021-11-22T04:14:44Z")

</div>

使用filelocator全文检索文本化的字典，这种思路真好！看大家讨论，这种方法的实现需要有文本化的词典才行，本人小白一枚，向大家请教一下，采用我们论坛中众多词典的mdx，然后将其解压开来，也会产生一个txt文件，那么这种文本文件可以利用filelocator进行全文检索吗？望大家不吝赐教啊！

---

<div class="post-metadata">

作者： ![dictionaryfan](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@dictionaryfan](https://forum.freemdict.com/u/dictionaryfan)\
发布日期： [2021 年11 月 22 日 07:27 UTC](https://forum.freemdict.com/t/topic/2045/21 "2021-11-22T07:27:53Z")

</div>

基本是这样的思路，最好把标签洗去

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