在线命令行同义词库?

在线命令行同义词库?

我最近偶然发现询问离线命令行词典的建议的问题。

本着同样的精神,有没有在线命令行同义词典适用于 Ubuntu 吗?

答案1

不在 Debian 和 Ubuntu 存储库中,但你可以从 Github 尝试一下davidgu/同义词库-cli

安装说明和使用方法位于存储库链接上。

答案2

这对我有用:

sudo apt install xclip notify-send dict

然后把这个命令放在某个键盘快捷键上

notify-send "$(dict -d moby-thesaurus "$(xclip -o -selection primary)")"

例如在 xfce4 中,上述命令包含在脚本“thesaurus.sh”中:

xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Super>t" -n -t string -s "thesaurus.sh"

然后突出显示有问题的单词并按Super+t应该会弹出替代单词。

答案3

无法运行建议的答案,安装失败,而且似乎 thesaurus.com 已变为仅支持 javascript。所以我很快就完成了,因为我自己想要这个:

perl -wlE 'use Mojo::JSON qw/decode_json/; use Mojo::UserAgent; my $word = shift; my $tx = Mojo::UserAgent->new->get("https://www.thesaurus.com/browse/" . $word); if ($tx->res->body =~ /<script>window.INITIAL_STATE = (.*?);<\/script>/) { my $json = $1; $json =~ s/\bundefined\b/null/gmx; my @defs = @{ decode_json($json)->{searchData}->{relatedWordsApiData}->{data} }; print "$word:"; for my $def (@defs) { print "  $def->{definition}:"; print "    synonyms: " . join ", ", (map { $_->{term} } @{ $def->{synonyms} }); print "    antonyms: " . join ", ", (map { $_->{term} } @{ $def->{antonyms} }); } } else { die "$word not found" unless $word; }' clumsy
clumsy:
  crude, awkward:
    synonyms: bad-mannered, barbaric, bearish, cantankerous, churlish, cloddish, clodhopping, clownish, clumsy, coarse, countrified, gross, gruff, ill-bred, ill-mannered, impolite, inurbane, loud, loutish, lowbred, oafish, ornery, out-of-line, out-of-order, provincial, rough, rude, rustic, swinish, tasteless, ugly, uncivilized, uncouth, uncultured, uneducated, ungracious, unpoised, unpolished, unrefined, vulgar
    antonyms: delicate, gentle, smooth, sophisticated, refined, polished, nice, exciting, cultured, charming, pleasant, polite, mannerly, kind
  unskillful:
    synonyms: awkward, blundering, bungling, butterfingered, clumsy, gauche, graceless, inept, maladroit, unpolished
    antonyms: 
  vulgar, unpolished in manner:
    synonyms: awkward, backward, barnyard, boorish, cheap, cloddish, clumsy, coarse, crass, dirty, earthy, filthy, foul, grody, gross, ignorant, ill-bred, indecent, indelicate, inelegant, insensible, lewd, loud, loud-mouthed, loutish, lowbred, oafish, obscene, raunchy, raw, rough, rude, savage, smutty, tacky, tactless, uncouth, unenlightened, ungainly, unskillful
    antonyms: formal, polished, gentle, delicate, smooth, nice, pure, decent, clean, sophisticated, refined, stilted, planned, tasteful, moral, kind, polite
  vulgar, unpolished in manner:
    synonyms: awkward, backward, barnyard, boorish, cheap, cloddish, clumsy, coarse, crass, dirty, earthy, filthy, foul, grody, gross, ignorant, ill-bred, indecent, indelicate, inelegant, insensible, lewd, loud, loud-mouthed, loutish, lowbred, oafish, obscene, raunchy, raw, rough, rude, savage, smutty, tacky, tactless, uncouth, unenlightened, ungainly, unskillful
    antonyms: formal, polished, gentle, delicate, smooth, nice, pure, decent, clean, sophisticated, refined, stilted, planned, tasteful, moral, kind, polite
  cumbersome:
    synonyms: awkward, bulky, clumsy, heavy, hefty, ungainly, unmanageable, unwieldy
    antonyms: 
  tactless, unsophisticated:
    synonyms: awkward, bumbling, clumsy, crude, graceless, green, halting, ham-handed, heavy-handed, ignorant, ill-bred, ill-mannered, inelegant, inept, insensitive, lacking, maladroit, oafish, uncouth, uncultured, unhappy, unpolished, wooden
    antonyms: sophisticated, refined, polished, tasteful, tactful, mannerly, graceful, elegant

相关内容