is there a free command line tool (with database) to find synonyms/antonyms (linux)? where can i get it?

link|improve this question
feedback

2 Answers

You could use Wordnet. The command line utility wn includes thesaurus features.

$ wn glow -n1 -synsv

Synonyms/Hypernyms (Ordered by Estimated Frequency) of verb glow

Sense 1
glow
       => radiate

$ wn slow -n2 -antsa

Antonyms of adj slow

Sense 2
slow (vs. fast)

fast (vs. slow)
        => allegro
        => allegretto
        => andantino
        => presto
        => prestissimo
        => vivace

This page shows a script you can use that uses lynx and dictionary.com.

#!/bin/sh 
#-------- 
# Command line thesaurus 

BROWSER="/usr/bin/lynx -source" 
WEBSITE="http://thesaurus.reference.com/search?q=$1" 
HTML2TEXT="/usr/bin/html2text -style compact" 

if test $1; then 
    ${BROWSER} ${WEBSITE} | ${HTML2TEXT} | ${PAGER} 
else 
    echo "Usage: $0 word" 
    exit 1 
fi

To use this script, name it thes, make it executable, and make sure that it's in your $PATH. Then, run the script followed by the word you're interested in. Code Listing 2

$ thes word
link|improve this answer
feedback

If you manage to find the necessary dictionary files in any 'open' format such as stardict, DSL, xdxf, Babylon BGL (this one is not really open, but there are tons of free dictionaries on their site), etc, then you can convert them to stardict format and use them from console using sdcv. Conversion can be done via makedict and/or dictconv.

Another option would be using the google dictionary:

with w3m:

w3m 'http://www.google.com/dictionary?langpair=en%7Cen&q=word&hl=en&aq=f'

with curl+html2text:

curl -s 'http://www.google.com/dictionary?langpair=en%7Cen&q=word&hl=en&aq=f' | html2text

I while ago I blogged about using dictionaries and google translate from console.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.