mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
[Translated]How To Look Up Dictionary Definitions Via Terminal
This commit is contained in:
parent
f5e13db58d
commit
c83847df7e
@ -1,29 +1,25 @@
|
|||||||
Translating-----------geekpi
|
如何通过终端查询字典定义
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
How To Look Up Dictionary Definitions Via Terminal
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Most people when they find a word they’re not familiar with, they Google it. Either that or they have a favorite online dictionary that provides an answer. What happens when you have no network connectivity? Or maybe you have an older distribution of Linux and you don’t have a GUI? You need to look it up offline. A good way to do that is here.
|
大多数人在遇到他们不熟悉的单词时会查询google。或者他们有一个最喜欢的在线字典来提供答案。当你在没有网络连接的时候怎么办?或者你只有一个古老的Linux发行版且你没有GUI界面?你需要离线查找。一个好的方法在这里。
|
||||||
|
|
||||||
First you need to set up dictd locally. **Dictd** is a dictionary database server. It allows you to access online dictionaries. But wait, that’s what we wanted to avoid, right? A connection over the Internet. That’s why you set it up on localhost. It comes with a command-line client.
|
首先你需要本地设置dicted。**Dicted** 是一个字典数据库服务器。它允许你访问在线字典。但是等一下,这是我们希望避免的,对么?一个通过因特网的连接。这是为什么你要在本地设置。这是一个命令行客户端。
|
||||||
|
|
||||||
To install dictd on Ubuntu or Debian you type:
|
要在Ubuntu或者Debian上安装你要输入:
|
||||||
|
|
||||||
$ sudo apt-get install dictd
|
$ sudo apt-get install dictd
|
||||||
|
|
||||||
That was easy. Now you need to install dictionaries for it to use. After each dictionary addition dictd will automatically restart to reload its databases. Let’s say we want to install the English dictionary and an English thesaurus (look up synonyms).
|
这个很简单。现在你需要安装用的字典。安装完每个字典插件后dicted都会自动重启加载它的数据库。让我们来英语字典和英语词库(查询近义词)
|
||||||
|
|
||||||
Type:
|
输入:
|
||||||
|
|
||||||
$ sudo apt-get install dict-gcide
|
$ sudo apt-get install dict-gcide
|
||||||
$ sudo apt-get install dict-moby-thesaurus
|
$ sudo apt-get install dict-moby-thesaurus
|
||||||
|
|
||||||
If you want another language you can check the other packages by typing:
|
如果你希望查询其他可以查询的语言,你可以输入:
|
||||||
|
|
||||||
$ sudo apt-cache search “dict package”
|
$ sudo apt-cache search “dict package”
|
||||||
|
|
||||||
That will give you a list like:
|
这会列出下面这样的:
|
||||||
|
|
||||||
dict-freedict-eng-ara - Dict package for English-Arabic Freedict dictionary
|
dict-freedict-eng-ara - Dict package for English-Arabic Freedict dictionary
|
||||||
dict-freedict-eng-cro - Dict package for English-Croatian Freedict dictionary
|
dict-freedict-eng-cro - Dict package for English-Croatian Freedict dictionary
|
||||||
@ -31,13 +27,13 @@ That will give you a list like:
|
|||||||
dict-freedict-eng-deu - Dict package for English-German Freedict dictionary
|
dict-freedict-eng-deu - Dict package for English-German Freedict dictionary
|
||||||
dict-freedict-eng-fra - Dict package for English-French Freedict dictionary
|
dict-freedict-eng-fra - Dict package for English-French Freedict dictionary
|
||||||
|
|
||||||
Now after that you have successfully installed dictd and can look up definitions.
|
你成功安装完成dicted之后你可以查找定义。
|
||||||
|
|
||||||
First, let’s check if dictd server is running and what databases are installed:
|
首先,让我们检查一下dicted服务是否在运行并且安装了什么数据库:
|
||||||
|
|
||||||
$ dict -I
|
$ dict -I
|
||||||
|
|
||||||
Example of output:
|
示例输出:
|
||||||
|
|
||||||
dictd 1.12.0/rf on Linux 3.2.0-29-generic-pae
|
dictd 1.12.0/rf on Linux 3.2.0-29-generic-pae
|
||||||
On my_host: up 95.000, 2 forks (75.8/hour)
|
On my_host: up 95.000, 2 forks (75.8/hour)
|
||||||
@ -46,16 +42,16 @@ Example of output:
|
|||||||
gcide 203645 3859 kB 12 MB 38 MB
|
gcide 203645 3859 kB 12 MB 38 MB
|
||||||
moby-thesaurus 30263 528 kB 10 MB 28 MB
|
moby-thesaurus 30263 528 kB 10 MB 28 MB
|
||||||
|
|
||||||
To look up a word definition you need to use a particular dictionary of those you have installed. Let’s check the English one (gcide):
|
为了查询一个你需要的单词定义,你需要使用一个你已经安装的特别字典。让我们检查一下英语(gcid):
|
||||||
|
|
||||||
$ dict -d gcide [word you want to look up]
|
$ dict -d gcide [word you want to look up]
|
||||||
|
|
||||||
If you don’t use the **-d** parameter dictd will search all available databases and return matched definitions.
|
如果你不使用**-d** 参数,dicted会搜寻所有的已有数据库并返回匹配的定义。
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
via: http://www.unixmen.com/look-dictionary-definitions-via-terminal/
|
via: http://www.unixmen.com/look-dictionary-definitions-via-terminal/
|
||||||
|
|
||||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||||
|
Loading…
Reference in New Issue
Block a user