是否有离线命令行字典?

有没有命令行离线词典? 我知道有一些像StarDictArtha但是在命令行中有一个怎么样?

另外,我尝试了dict但它是一个在线词典。

sdcvStardict的控制台版本。

1.安装字典

在终端中运行以下命令:

 sudo apt-get install sdcv 

2.下载字典文件

从以下来源根据您的要求下载字典文件。

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 。 并且通过按nN来显示模式的下一个或上一个,更有趣的是找到单词的含义。