Pyvoc – 命令行字典和词汇构建工具

对于非英语母语人士来说,我有一个好消息。 现在,您可以直接从终端提高您的英语词汇量并找到英语单词的含义。 打招呼 派沃克, 一个跨平台的开源命令行词典和词汇构建工具 Python 编程语言。

使用此工具,您可以复习一些英语单词的含义,测试或提高您的词汇技能,或者简单地将其用作类 Unix 操作系统上的 CLI 词典。

内容

  1. 在 Linux 中安装 Pyvoc
  2. 如何使用 Pyvoc 作为命令行词典工具和词汇构建工具
    1. 创建词汇组
    2. 测试和提高英语词汇量

在 Linux 中安装 Pyvoc

由于 Pyvoc 是使用 Python 语言编写的,因此您可以使用 点3 包管理器。

安装 Pip 后,运行以下命令安装 Pyvoc。

$ pip3 install pyvoc

安装 Pyvoc 后,运行以下命令自动在你的系统中创建必要的配置文件 $HOME 目录。

$ pyvoc word

样本输出:

|Creating necessary config files /getting api keys. please handle with care! |  word  Noun: single meaningful element of speech or writing example: I don't like the word ‘unofficial’  Verb: express something spoken or written example: he words his request in a particularly ironic way  Interjection: used to express agreement or affirmation example: Word, that's a good record, man

如果 Pyvoc 命令不可用,只需注销并重新登录。

完毕! 让我们继续提高一点英语技能。

如何使用 Pyvoc 作为命令行词典工具和词汇构建工具

Pyvoc 从 牛津词典 API.

让我们说,你想找到一个词的意思 “题外话”. 为此,请运行:

$ pyvoc digression
使用 Pyvoc 查找词义

看? Pyvoc 不仅显示单词的含义 “题外话”,还有一个例句,说明如何在实际中使用该词。

让我们看另一个例子。

$ pyvoc subterfuge |  subterfuge  Noun: deceit used in order to achieve one's goal example: he had to use subterfuge and bluff on many occasions

它还显示了单词类。 正如你已经知道的, 英语有四个专业 词类

  1. 名词,
  2. 动词,
  3. 形容词,
  4. 副词。

看看下面的例子。

$ pyvoc welcome  /  welcome  Noun:            instance or manner of greeting someone example:         you will receive a warm welcome  Interjection:    used to greet someone in polite or friendly way example:         welcome to the Wildlife Park  Verb:            greet someone arriving in polite or friendly way example:         hotels should welcome guests in their own language  Adjective:       gladly received example:         I'm pleased to see you, lad—you're welcome

正如您在上面的输出中看到的,“欢迎”这个词可以用作动词、名词、形容词和感叹词。 Pyvoc 为每个类提供了示例。

如果您拼错一个单词,它会通知您检查给定单词的拼写。

$ pyvoc wlecome  No definition found. Please check the spelling!!

有用,不是吗?

创建词汇组

词汇组只不过是用户添加的一个集合词。 您可以稍后从这些组中修改或参加测验。 100组60字是 预订的 为用户。

添加一个词(例如 零星的) 到一个组,只需运行:

$ pyvoc sporadic -a -  sporadic  Adjective: occurring at irregular intervals or only in few places example: sporadic fighting broke out   writing to vocabulary group... word added to group number 51

如您所见,我没有提供任何组号,pyvoc 显示给定单词的含义并自动将该单词添加到组号 51. 如果您不提供组号,Pyvoc 将 逐步添加单词 给团体 51-100.

如果您愿意,Pyvoc 还允许您指定组号。 您可以使用 1-50 指定一个组 -G 选项。 例如,我将使用以下命令将一个单词添加到词汇组 20。

$ pyvoc discrete -a -g 20  /  discrete  Adjective:       individually separate and distinct example:         speech sounds are produced as a continuous sound signal rather                than discrete units  creating group Number 20... writing to vocabulary group... word added to group number 20

看? 上述命令显示“离散”单词的含义并将其添加到词汇组 20。如果该组不存在,Pyvoc 将创建它并添加该单词。

默认情况下,Pyvoc 包括三个预定义的词汇组(101、102 和 103)。 这些自定义组每个有 800 个单词。 这些组中的所有单词均取自 GRESAT 准备网站。

要查看用户生成的组,只需运行:

$ pyvoc word -l  -  word  Noun:            single meaningful element of speech or writing example:         I don't like the word ‘unofficial’  Verb:            express something spoken or written example:         he words his request in a particularly ironic way  Interjection:    used to express agreement or affirmation example:         Word, that's a good record, man   USER GROUPS Group no.      No. of words 20             1  DEFAULT GROUP Group no.      No. of words 51             1
 

如您所见,我创建了一个组 (20),包括默认组 (51)。

测试和提高英语词汇量

正如我已经说过的,您可以使用词汇组来修改或从中进行测验。

例如,修改组号。 101, 利用 -r 选项如下。

$ pyvoc 101 -r

您现在可以按随机顺序修改词汇组 101 中所有单词的含义。 只需按 ENTER 即可完成下一个问题。 完成后,点击 CTRL+C 退出。

修改词汇组

此外,您还可以从现有小组中进行测验以提高您的词汇量。 为此,请使用 -q 选项如下。

$ pyvoc 103 -q 50

此命令允许您对词汇组 103 中的 50 个问题进行测验。通过输入适当的数字从列表中选择正确答案。 每答对一题,您将获得 1 分。 你得分越高,你的词汇技能就越多。

使用 Pyvoc 进行测验使用 Pyvoc 进行测验

Pyvoc 处于早期开发阶段。 我希望开发者能够改进它并在未来的日子里添加更多功能。

作为一个非英语母语的人,我个人觉得在闲暇时间测试和学习新词的含义很有用。 如果您是重度命令行用户并想快速检查单词的含义,那么 Pyvoc 是正确的工具。 您还可以在空闲时间测试您的英语词汇,以记住和提高您的英语语言技能。

资源:

  • Pyvoc GitHub 存储库

DictionaryLearn English VocabularyLinux开源PythonPyvoc