Follow Me On Twitter

Friday, January 13, 2017

Offline Dictionary For Linux


When I had a Windows PC, I could find dozens of dictionary apps on the web; one for English-English, the other for a thesaurus, etc. Each type of dictionary came with its own app. At first, I appreciated this, after all, you could get an app for any kind of dictionary you wanted. As a Linux noob, I always missed this one particular feature.

But the fact is that Linux has a much more flexible way to do this (as with most other things). It is called a DICT server. DICT is a protocol where a client requests for a word and the server looks into multiples databases returning the result. What is flexible about this method is that you don't need multiple clients for each type of dictionary you want.

In this post, I will discuss how you can set up your ultimate dictionary for offline and command line use.


Installing DICT

 

I will cover the Debian package management commands as they are the most common. However, the logic is same and should work with every Linux distro (as well as on BSDish systems).

You only need to install the dictd package to get both the DICT server and the client. As you would expect, dictd is a daemon which is signified by the trailing d. Run the following command as root to install the package:

# apt install dictd 

However, this doesn't install any database, you will need to do it manually which is a good thing! The GCIDE is the English-English open source dictionary created by GNU and open source contributors. Install it if you need it by running the following command as root:

# apt install dict-gcid

Similarly, there are a bunch of servers to choose from. All of them follow this regular expression: ^dict-.*. You can list them using the following command:

$ apt list 'dict-*'

There are around 100 servers available in the official Debian Stable repositories.

Using dict

 

dict is a command line dictionary and can be used offline as well (offline in the sense of not being connected to the Internet). You can simply run the dict command with the word you want to know the meaning of as the first arguments, like this:

$ dict dictionary

Some of My Favorite DICT databases

 

In this section, I  will list some of my favorite DICT databases I suggest everyone have. They are not only useful but some are also satirical.

  1. GCIDE (dict-gcide): This is the ultimate English-English dictionary you will need in your day-to-day life.
  2. The Devil's Dictionary (dict-devil): This dictionary is a collection of common terms defined in funny ways. I have seen many fortune cookies containing the pages from this dictionary.
  3. Elements (dict-elements): You might not be a chemist but this dictionary might be interesting. It is a compilation of physical and chemical data about different elements.
  4. FOLDOC (dict-foldoc): FOLDOC stands for Free On Line Dictionary Of Computing. It is a collection of computing terms along with their detailed description and often the term's history.
Let me know in the comments if your favorite dictionary database is not present above.

No comments:

Post a Comment