是否有离线命令行字典?
有没有命令行离线词典? 我知道有一些像StarDict和Artha但是在命令行中有一个怎么样?
另外,我尝试了dict
但它是一个在线词典。
sdcv是Stardict的控制台版本。
1.安装字典
在终端中运行以下命令:
sudo apt-get install sdcv
2.下载字典文件
从以下来源根据您的要求下载字典文件。
- dictd-www.dict.org词典列表(已存档):
- 协作国际英语词典 (GPL,35MB,174222字)( 从archive.org下载tarball )
- https://web.archive.org/web/20140428004049/http://abloz.com/huzheng/stardict-dic/misc/
- 免费在线计算词典
- 行话文件 – 黑客俚语的综合纲要,阐明了黑客传统,民间传说和幽默的许多方面
- GNU Linux英语 – 英语词典
3.安装下载的词典
sdcv
查找字典的目录:
sudo mkdir -p /usr/share/stardict/dic/
下一个命令取决于下载的文件是.gz
文件还是.bz2
文件。
如果是.bz2
文件:
sudo tar -xvjf downloaded.tar.bz2 -C /usr/share/stardict/dic
如果是.gz
文件:
sudo tar -xvzf downlaoded.tar.gz -C /usr/share/stardict/dic
做完了!
要搜索单词,请使用:
sdcv word
轻松离线dictd
安装
合理
dict
命令可以很容易地与离线词典一起使用。 只需将dictd
守护程序及其依赖项与本地脱机字典一起安装dictd
。 这比根据本页其他地方的建议安装sdcv
要简单得多。
安装
下面显示了如何安装dictd
以及dict-gcide
dictd
综合英语词典。 标准存储库中还有许多可用的字典 。
$ sudo apt-get install dict dictd dict-gcide
用法
$ dict word 3 definitions found From The Collaborative International Dictionary of English v.0.48 [gcide]: Word \Word\, n. [AS. word; akin to OFries. & OS. word, D. woord, G. wort, Icel. or[eth], Sw. & Dan. ord, Goth. wa['u]rd, OPruss. wirds, Lith. vardas a name, L. verbum a word; or perhaps to Gr. "rh`twr an orator. Cf. {Verb}.] [1913 Webster] 1. The spoken sign of a conception or an idea; an articulate or vocal sound, or a combination of articulate and vocal sounds, uttered by the human voice, and by custom expressing an idea or ideas; a single component part of human speech or language; a constituent part of a sentence; a term; a vocable. "A glutton of words." --Piers Plowman. [1913 Webster] You cram these words into mine ears, against The stomach of my sense. --Shak. [1913 Webster] Amongst men who confound their ideas with words, there must be endless disputes. --Locke. [1913 Webster] 2. Hence, the written or printed character, or combination of characters, expressing such a term; as, the words on a page. [1913 Webster] 3. pl. Talk; discourse; speech; language. [1913 Webster]
您可能还安装了aspell
,这样可以为拼写错误的单词提供建议。 您可以使用以下命令直接在文本文件上调用aspell
:
aspell check text.txt
或者在一个单词上使用它:
echo wrd | aspell -a
如果您只是想查看单词拼写是否正确或存在,您可以使用grep查看/ usr / share / dict /中的单词列表文件,这些文件由相应的wordlist包提供。 查看“emu”是否为有效单词的示例:
grep -i "^emu$" /usr/share/dict/american-english
但是,这没有任何定义。
如何从站点下载字典文本文件,例如此链接 ( 警告 :4.5 MB),然后使用grep "word" dictionary.txt
等命令查找文本
或者也可以使用VIM编辑器通过命令搜索单词,例如。 /Word
。 并且通过按n或N来显示模式的下一个或上一个,更有趣的是找到单词的含义。