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?
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?
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.
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.
N: Unable to locate package notify-send E: No packages found
when I try to install it. It doesn't seem to be in Kubuntu. libnotify-bin
is for Ubuntu and others, not Kubuntu.
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("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
libmojolicious-perl
, or do I need more modules? The line throws an error that mojo is missing -- can't locate Mojo/JSON.pm
. When I install it, I still get malformed JSON string, neither tag, array, object, number, string or atom, at character offset 6708 (before "undefined,"key":"f6j...") at /usr/share/perl5/Mojo/JSON.pm line 31.