一个很小的命令行字典,可以刮到youdao.com。只是为了好玩。
dict-tin的Python项目详细描述
dict tiny
dict tiny是一个命令行实用程序,可以翻译英文和中文单词,这使得从命令行界面翻译单词变得很容易。只是为了好玩:)
您可以通过这种方式使用dict-tiny
:
翻译英语单词或汉语单词
$ dict-tiny book book 英[bʊk]美[bʊk]=================== n. 书籍;卷;账簿;名册;工作簿 vt. 预订;登记 n. (Book)人名;(中)卜(广东话·威妥玛);(朝)北;(英)布
$ dict-tiny 书 书 [shū]========= n.book;letter;script vt.write
在剪贴板中翻译单词
使用-c
/--clipboard
翻译剪贴板中的单词:
$ dict-tiny -c 命令行======command line
注意:
-c
/--clipboard
具有高优先级。如果同时添加-c
和单词,则该单词将被视为无效。
获取有关单词
的更多详细翻译使用-m
/--more
获得更多详细翻译:
$ dict-tiny 曾经 -m 曾经 [céng jīng]================= adv.once;ever more detail: ========副词========1: (表示有过某些行为或情况) once: He once lived in Shanghai. 他曾经在上海住过。 She has taken part in a major battle for oil. 她曾经参加过石油大会战。
$ dict-tiny dictionary -m dictionary 英['dɪkʃ(ə)n(ə)rɪ]美['dɪkʃə'nɛri]============================================= n. 字典;词典 more detail (collins): ======== N-COUNT 可数名词======== · 词典 A dictionary is a book in which the words and phrases of a language are listed alphabetically, together with their meanings or their translations in another language. 例: ...a Spanish-English dictionary. …一本西班牙语—英语词典。
注意:
- 您可以同时使用
-c
和-m
,这意味着可以在剪贴板中获得有关单词的更多详细翻译。 - 有些单词有很多可能占据整个屏幕的翻译。
安装
您可以通过pip包管理器安装dict-tiny
。
$ pip3 install dict-tiny
升级
$ pip3 install --upgrade dict-tiny