Online Command-Line Thesaurus?

I recently stumbled upon this question asking for recommendations for an offline command-line dictionary.

In the same spirit, is there any online command-line thesaurus available for Ubuntu?

0

3 Answers

Not on the Debian and Ubuntu repositories but you can try this one out from Github davidgu/thesaurus-cli.

Installation instructions and usage are on the repository link.

1

This worked for me:

sudo apt install xclip notify-send dict

and then put this command on some keyboard shortcut

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

e.g in xfce4, where the above command is contained in the script "thesaurus.sh":

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

Then highlight the word in question and press Super+t should pop up alternative words.

2

Wasn't able to run the proposed answer, failed in installation, also seems like thesaurus.com has gone javascript-only. So I quickly wrapped up this as I wanted this myself:

perl -wlE 'use Mojo::JSON qw/decode_json/; use Mojo::UserAgent; my $word = shift; my $tx = Mojo::UserAgent->new->get("" . $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
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest