nix*终端的字典程序
wordp的Python项目详细描述
wordpy
用于nix*终端的字典程序
安装
只需使用pip安装最新的稳定版本-
$ pip install wordpy
要获得最新版本-
pip install git+https://github.com/mentix02/wordpy.git
要求
wordpy可用于所有Unix和类Unix操作系统它支持Python3.6及更高版本。
用法
获取api密钥
不存在Oxford Dictionaries,这个包是不可能的。然而,服务托管是昂贵的,他们必须自己赚一些钱,所以他们只让一个简单的,开发人员为他们的prolix api选择。注册它here。
当您第一次使用wordpy时,您将收到一个提示,输入您最近获得的凭据并将其存储以备将来使用。别担心,一切都在你的本地系统里。
这个程序非常简单-你只需在终端中得到一个单词的定义。或者同义词,反义词,甚至词源,如词源,如果你觉得冒险
标志
Flag | Usage |
---|---|
-s, --synonyms | display synonyms |
-a, --antonyms | display antonyms |
-e, --etymology | show etymology |
-v, --version | display version |
-h, --help | show help message |
命令
$ wordpy <word>
为了得到同义词-
$ wordpy -s <word>
反义词可以通过-
$ wordpy -a <word>
最后,词源-
$ wordpy -e <word>
这些标志可以组合起来得到用户要求的任何东西。例如,要获得定义、反义词和词源,可以使用-
$ wordpy -ae <word>
示例
$ wordpy apple [s] Apple (noun) The round fruit of a tree of the rose family, which typically has thin green or red skin and crisp flesh.
$ wordpy -s car # synonyms[s] Car (noun) A road vehicle, typically with four wheels, powered by an internal combustion engine and able to carry a small number of people [s] Synonyms auto, automobile, bus, convertible, jeep, limousine, machine, motor, pickup, ride, station wagon, truck, van, wagon, bucket, buggy, compact, conveyance, coupe, hardtop, hatchback, heap, jalopy, junker, motorcar, roadster, sedan, subcompact, wheels, wreck, clunker, gas guzzler, touring car
$ wordpy -as happy # antonyms and synonyms[s] Happy (adjective) Feeling or showing pleasure or contentment [s] Synonyms cheerful, contented, delighted, ecstatic, elated, glad, joyful, joyous, jubilant, lively, merry, overjoyed, peaceful, pleasant, pleased, thrilled, upbeat, blessed, blest, blissful, blithe, can't complain, captivated, chipper, chirpy, content, convivial, exultant, flying high, gay, gleeful, gratified, intoxicated, jolly, laughing, light, looking good, mirthful, on cloud nine, peppy, perky, playful, sparkling, sunny, tickled, tickled pink, up, walking on air [s] Antonyms depressed, disappointed, disturbed, down, grave, melancholy, miserable, sad, serious, sorrowful, troubled, unfriendly, unhappy, upset, discouraged, dissatisfied, forsaken, hopeless, morose, pained, unfortunate, unlucky
$ wordpy -e computer [s] Computer (noun) An electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program. [s] Etymology 1640s, "one who calculates," agent noun from compute (v.). Meaning "calculating machine"(of any type) is from 1897; in modern use, "programmable digital electronic computer"(1945 under this name; theoretical from 1937, as Turing machine). ENIAC (1946) usually is considered the first. Computer literacy is recorded from 1970; an attempt to establish computerate (adjective, on model of literate) in this sense in the early 1980s didn't catch on. Computerese "the jargon of programmers" is from 1960, as are computerize and computerization.
开发
贡献
如果你偶然发现一个错误,就提出一个问题。任何你想添加的想法或功能,再一次,提出一个问题。
要做一些更模拟的事情,比如编写代码,只需克隆这个repo,在本地系统上获取它,创建一个分支,将它推回到主服务器,最后发出一个pull请求。
我跟着PEP-8,所以你也得跟着。不明白为什么语法中还没有包含这些。
测试
要运行测试,只需安装nose-
$ pip install nose
$ python setup.py test
或者运行nosetests
以获得更干净的输出-
$ nosetests
我从来都不喜欢测试…让我换一种说法,我从来都不喜欢自己编写测试,但是tests/
中有一些测试应该在您考虑提交之前就成功了
任何新特性都应该在所述目录中带有自己的test_<name_of_feature>.py
文件,并且至少有两种情况下应该是冗长的。
要添加的功能
- [X]基本用法
- [X]测试
- []优化
- []文件(?)
- []更多功能
- [X]反义词
- [X]词源
- []不同的定义