Tuesday, March 1


Having a computer look up words for you in a dictionary can be a great timesaver sometimes, especially if you need to check many words. There are several choices of a computerised dictionary.

A simple and straightforward choice is to use a web-based dictionary. You can usually find some quite complete and verbose ones with many examples. Some sites even provide other linguistic data (this database really impressed me). Besides, Google is always handy to search for extra information.

If you have a text that has many unknown words, it might be faster to run it through a general-purpose translator, such as translate.google.com. You will lose precision, but at least you might get a good laugh from the results.

Having the dictionary installed locally is more convenient (you do not need an internet connection) and faster (almost zero latency). For some languages specialised dictionary software is available, but there is also the dict network protocol which defines a standard way for a generic dictionary client and a dictionary server to communicate. This model is quite powerful.

Setting up a dict server on Linux is not hard, in Debian it's just an apt-get install dictd away. Note that you will need to install the dictionaries yourself. Debian provides some dictionaries, e.g., dict-de-en. There is also a number of dict-freedict-* packages, but I have the impression that they are not very complete.

Now that you have a server running, you need a client to use it. There are quite a few clients available, I will mention several:

  • dict - the command-line client. Just type dict foo in a terminal and you'll get the query results immediately. Very handy but not convienient for looking up many words
  • gnome-dictionary - the GNOME dictionary client (screenshot, look on the right - not to the point, but will do). Looks nice at first but in my opinion it is not very usable, I hate the popup window when no matches are found for a query. And it pushes GNOME's "live preferences" to the uncomfortable limit - when you enter a new server, the same preferences dialog box is immediately reconfigured to that server, which looks very awkward.
  • kdict - the KDE dictionary client (screenshot). I slightly disliked it because the input box would lose focus after executing a query, so I would have to use the mouse to enter another word. Jeez, even the web-based dictionaries get this right with some JavaScript. The problem can be worked around with by mapping Ctrl+L to the "Clear Input Field" action. I would rather it selected the word instead of deleting it, but this solution is satisfactory. In addition, kdict offers database sets, which turns out to be very helpful. In most dict clients you can only query either a single dictionary or all dictionaries available. Database sets are like virtual dictionaries. An example of a use case is when you want to translate from English to another language and you have several dictionaries for this purpose, but you don't want the general-purpose ones to get in the way.

After finding out about the Ctrl+L tweak I liked KDict best. I would prefer it to be a GTK+ application rather than Qt, but it is practical, which matters most to me.


Anonymous said...

And what qualities/features are you looking for in a dict client ?
What is your standard workflow ?

Gintautas Miliauskas said...

As I mentioned, I am quite content with KDict. I value usability and simplicity most in this case (quite odd that I find a KDE app more usable than a GNOME app, isn't it?) Typically I am reading a text (on paper) in German and need to look up some words, so I want to type in a word and get a translation quickly, without popups or having to use the mouse.

As for the features, I guess I wouldn't mind active clipboard tracking, i.e., you put the client window on top of your browser window and a translation is shown whenever you select a word. KDict can be asked to translate the clipboard and you can bind a key to this command (I just love KDE-style shortcut configuration), which is good enough.