Command line dictionary


WordNet is a lexical database for the English language. It groups English words into sets of synonyms called synsets, provides short, general definitions, and records the various semantic relations between these synonym sets. The purpose is twofold: to produce a combination of dictionary and thesaurus that is more intuitively usable, and to support automatic text analysis and artificial intelligence applications.

We can use WordNet as command line dictionary.

To install WordNet use following command in Debian or Ubuntu Operating system:

$ sudo apt-get install wordnet

If you are using some other Operating system, download WordNet tar.gz from here. Then un-compress it in a directory.

Use following command to get meaning of the word.

$ wn InputWord -over


$ wn hello -over 

If you are installed with tar.gz fine go to the uncompressed directory and run command as below

$ ./wn hello -over 


Overview of noun hello

The noun hello has 1 sense (first 1 from tagged texts)

1. (1) hello, hullo, hi, howdy, how-do-you-do — (an expression of greeting; “every morning they exchanged polite hellos”)

To access it easily add “dictionary” script in /usr/sbin directory as shown below:

Open /usr/sbin/dictionary with any editor, and add following line in it

wn $1 -over | grep -v "^$"

If you are installed WordNet from tar.gz file, please give absolute path of uncompressed WordNet directory in front of wn as shown below:

 /home/xyz/WordNet/wn $1 -over | grep -v "^$"

/home/xyz/WordNet/ is the absolute path of WordNet directory.

After updating above command in dictionary file save and exit form it.

Now give executable permissions for dictionary file with following command

$ chomod a+x /usr/sbin/dictionary

To test it run dictionary <INPUT_WORD>, you can see the equivalent meaning of the input word on your konsole.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s