「教程」在Deepin(Linux)下如何优雅地查词典?—— sdcv ⚡📚

原创

本文最后更新于 <span id="expire-date"></span> 天前,文中部分描述可能已经过时。

sdcv = stardict console version ,即终端下的 stardict 词典

支持导入本地词典!

补充

man sdcv 发现 sdcv 有个 --color 参数,加上之后,字典名称和释义颜色有所区分,阅读效果稍稍好些。

Github 源码

有个 在线版,不知道什么关系。

Why sdcv ?

  1. 其它翻译工具要么需要联网(不稳定),要么作为本地词典但空间占用特别大(没必要)。
  2. stardict 星际译王 GUI 太老丑。
  3. sdcv 只需要开一个终端窗口就能用,反应迅速、使用方便、节约时间。

安装 sdcv

sudo apt install sdcv

下载词典包

前往 神人胡正的网站

将词典解压后存放至 ~/.stardict/dic ,如果目录不存在,则 mkdir -p ~/.stardict/dic 手动创建。

查看已安装词典

sdcv -l

点击展开
$ sdcv -l
Dictionary's name Word count
中国大百科全书2.0版 30624
段注說文解字 10737
朗道英汉字典5.0 435468
牛津高阶英汉双解 39433 # 不推荐 《牛津现代英汉双解词典》及其美化版,排版换行有问题。
新世纪汉英科技大词典 621241
汉语成语词典 13305
康熙字典文字版 46816
汉语辞海 380580
现代汉语词典 57691
英文字根字典 7835
本草纲目 765
CET4 4595
佛学大辞典 30928
朗道汉英字典5.0 405719
CET6 2043
新世纪英汉科技大词典 626953
古汉语常用字字典 3933
诗词典故词典 2947

将自用的 stardict 词典一次性打包收藏放在 蓝奏云,验证码:sdcv 。

使用方法

sdcv 关键词 查词,搜索结果较模糊的情况下,可能需要二次确认指定词典。

示例:

点击展开
& sdcv love       
Found 3 items, similar to love.
-->朗道英汉字典5.0
-->love

*[lʌv]
n. 爱, 恋爱, 爱情, 爱好, 性爱
vt. 爱, 爱好, 爱慕
vi. 爱
相关词组:
not for love nor money
have an ardent love for
I'd love to but...
for love or money
for the love of

-->牛津高阶英汉双解
-->love

/lʌv; lʌv/ n
1 [U] warm liking or affection; affectionatedevotion 喜爱; 热爱; 锺爱
*a mother's love for her children 母亲对其子女的爱
* love of (one's) country, ie patriotism 对祖国的热爱
* She has a great love for animals.
她酷爱动物.
* He shows little love towards her.
他没怎么表现出喜爱她.

2 [U] sexual affection or passion 性爱; 恋爱; 爱情
*marry for love, not money 为爱情而非为金钱结婚
* Their love has cooled, ie is no longer strong.
他们的爱情冷却了.

3 [U] (religion 宗) (in Christianity) God's benevolence towards mankind (基督教中)(上帝的)博爱, 慈爱.

4 [U, sing] strong liking for sth 酷爱某事物
*a love of learning, adventure, music 酷爱学习、冒险、音乐.

5 [C] person who is loved; sweetheart 恋人; 情人; 爱人
*Take care, my love.
小心, 亲爱的.
* one of my former loves 我从前的一个情人
* (joc 谑) with his lady love, ie his girlfriend or wife 带着他的爱人(女友或妻).

6 [C] (infml 口) delightful person or thing 招人喜爱的人或物
*What a love her daughter is! 她女儿多么可爱呀!
* Isn't this hat a perfect love? 这顶帽子挺可爱吧?
7 [C] (Brit infml 口) (form of address used by a man to a woman or child (not necessarily a friend), or by a woman to a person of either sex 男人用以称呼(不一定相识的)女子或儿童; 女子用以称呼他人(男女均可))
*Mind your head, love! 喂, 小心你的头!
8 [U] (in tennis) no score; nil (网球)零分
*love all, ie neither player or pair has scored 零比零
* The score in the game on Court One is thirty-love.
一号球场上的比分是三十比零.

9 (idm 习语) be in love (with sb) feel affection and desire (for sb) 热恋着(某人)
*They're very much in love (with each other).
他们(彼此)在热恋中.
* I'm madly in love with her.
我爱她爱得发狂.
be in love with sth be very fond of sth 喜爱某事物
*a city in love with its own past 热爱自身传统的城市
* He's in love with the sound of his own voice, ie talks too much.
他就喜欢自己的声音(太爱说话).
cupboard love => cupboard.
fall in love (with sb) feel a sudden strong attraction for sb 突然爱上某人.
(just) for `love/for the `love of sth without payment or other reward 出于爱好(不计报酬)
*They're all volunteers, doing it just for the love of the thing.
他们都是自愿的, 完全是因为喜欢做而做的.
for the ,love of `God, etc
(a) (expressing surprise, dismay, etc 用以表示惊奇、惊慌等)
*For the love of God, not another bill! 看在上帝的份上, 别再来账单了!
(b) (used when urging sb to do sth 用于催促某人做某事物)
*For the love of Mike let's get out of here! 看在上帝的份上, 咱们离开这鬼地方吧! ,give/,send sb one's `love give/send an affectionate greeting to sb 向某人致意
*Please give your sister my love.
请代我向令妹致意.
* My parents send their love.
我父母问您好.
a labour of love => labour1.
the ,love of sb's `life
(a) person's most dearly loved sweetheart 最理想的爱人
*I think I've met the love of my life.
我认为我已找到理想的爱人了.
(b) person's favourite possession, activity, etc 最喜爱的东西、活动等
*Sailing is the love of his life.
帆船运动是他最喜爱的活动.
make love (to sb)
(a) have sexual intercourse 做爱; 性交
*He refused to make love before they were married.
他决不在婚前发生性行为.
(b) (dated 旧) behave amorously (towards sb), esp by being specially attentive (向某人)表示爱情; (尤指)献殷勤.
not for ,love or `money not by any means 无论如何; 不管怎样
*We couldn't find a hotel room for love or money.
我们怎么也找不到一间旅馆客房.
there's little/no `love lost between A and B they dislike each other 他们彼此厌恶
*There's never been much love lost between her and her sister.
她和妹妹一向互相嫌恶.

/lʌv; lʌv/
v
1 [Tn] have a strong affection or deep tender feelings for (sb/sth) 爱, 热爱(某人[某事物])
*love one's parents, country, wife 爱父母、国家、妻子
* love God, ie worship Him 崇拜上帝.

2 [Tn, Tt, Tnt, Tg, Tsg] like (sb/sth) greatly; take pleasure in 喜欢(某人[某事物]); 喜好
*She's always loved horses.
她一向喜爱马匹.
* He loves his pipe, ie smoking it.
他爱抽烟斗.
* Children love to play/playing.
儿童喜欢玩要.
* `Will you come?' `I'd love to!' `你来吗?'`我很乐意!'
* We'd love you to come to dinner.
我们很愿意请你来吃饭.
* I love him reading to me in bed.
我喜欢在床上听他给我读点什么.

3 (idm 习语) ,love `me, ,love my `dog (saying 谚) if one loves sb, one will or should love everyone and everything associated with him 爱吾及犬; 爱屋及乌.

-->CET4
-->love

[lʌv]
n. 爱,恋爱,爱情
vt. 爱,热爱,喜欢
词形变化:
动词过去式:loved 过去分词:loved 现在分词:loving 第三人称单数:loves
例句与用法:
I think I've met the love of my life.
我认为我已找到理想的爱人了。
I love my motherland.
我爱我的祖国。
Her love for him never waved.
她对他的爱从未动摇过。

或者 sdcv 进行连续查词。

man sdcv 查看使用手册。

从此,在终端看到不认识的单词,就不必再打开浏览器了 🤣

添加热键

Deepin 的快捷键可以帮助我们快速启动一些命令。

控制中心 => 键盘和语言 => 快捷键 => 底部加号新建:

名称、快捷键随意,命令 sdcv


手机上也可以使用 Termux 进行安装:

点击展开
$ apt install sdcv
The following NEW packages will be installed:
sdcv
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 54.2 kB of archives.
After this operation, 197 kB of additional disk space will be used.

存储空间占用非常小,启动速度超快 👍

怎么想都比那些翻译机划算。


其它翻译工具推荐

考虑了一下,干脆再装两个需要联网使用的终端词典,查句子还得靠它们。

fanyi

使用 金山有道 的 api 。

安装:

sudo apt-get install festival festvox-kallpc16k

npm install fanyi -g

使用:
fy <字、词、句、段>

点击展开
$ fy love            
love [ lʌv ]

- n. 爱;爱情;喜好;(昵称)亲爱的;爱你的;心爱的人;钟爱之物;零分
- v. 爱恋(某人);关爱;喜欢(某物或某事);忠于
- n. (Love) (英、菲、瑞、美)洛夫(人名)

1. love
爱, 爱情, 爱心, 恋爱
2. First love
初恋, 初恋这件小事, 魔女的条件主题曲
3. love Letter
情书, 日本版, 爱的情书, 爱情信

translate-shell

默认使用谷歌翻译,还支持 Bing 、Yandex 、Apertium。

获取源码编译安装:

cd 合适的目录
git clone https://github.com/soimort/translate-shell
cd translate-shell/
make
sudo make install

使用示范:

  • 英译中
    trans en:zh ccp 或者 trans love (顺便鄙视一下谷歌翻译,查不出用法更妥当的 cpc )

  • 中译英
    trans zh:en 大丈夫 或者省略 zh trans :en 一见杨过误终生 trans 大丈夫 会被当做日语)

  • 听读音
    加上 -p 听译文读音
    加上 -sp 听输入的单词读音
    在后台可以看见它调用的是 mpv ,获取 Google TTS。
    mpv --no-config http://translate.googleapis.com/translate_tts?ie=UTF-8&client=gtx&tl=zh-CN&q=苟利国家生死以,岂因祸福避趋之。
    (我们 mpv 真是太厉害啦!)

有空格的句子需要用 '' 或者 "" 包起来。

详细用法

顺便加个 alias ggfy='trans :en'.zshrc


补充:Foliate(电子书阅读器)可以调用 sdcv 的本地词典。

本文作者:青菜芋子

本文链接: https://loafing.cn/posts/sdcv-dictionary-look-up-on-Deepin.html

文章默认采用 CC BY-NC-SA 4.0 许可协议,如有转载请注意遵循。

评论

您所在的地区可能无法访问 Disqus 评论系统,请切换网络环境再尝试。