Linux synonym /antonym application

3

Is there a free command line tool (preferably with a database) to find synonyms/antonyms in Linux? Where can I get it?

anon

Posted 2011-02-26T05:44:32.800

Reputation: 31

Answers

4

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

Paused until further notice.

Posted 2011-02-26T05:44:32.800

Reputation: 86 075

1

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.

ccpizza

Posted 2011-02-26T05:44:32.800

Reputation: 5 372