How To Use Webster’s 1913 Dictionary, Linux Edition

Accessing the one true dictionary via the command line

I suspect the overlap of Linux users and writers who care about the Webster’s 1913 dictionary is vanishingly small. Quite possible just me. But in case there are others, I am committing these words to internet. Plus I will need them in the future when I forget how I set this up.

Here is how you install, set up, and configure the command line app sdcv so that you too can have the one true dictionary at your fingertips in the command line app of your choosing.

But first, about the one true dictionary.

The one true dictionary is debatable I suppose. Feel free to debate. I have a “compact” version of the Oxford English Dictionary sitting on my desk and it is weighty both literally and figuratively in ways that the Webster’s 1913 is not, but any dictionary that deserves consideration as your one true dictionary ought to do more than spit out dry, banal collections of words.

John McPhee writes eloquently about the power of a dictionary in his famous New Yorker essay, Draft No 4, which you can find in paper in the compilation of essays by the same name. Fellow New Yorker writer James Somers has a brilliant essay on the genius of McPhee’s dictionary and how you can get it installed on your Mac.

Remarkably, the copy of the Webster’s 1913 that Somers put up is still available. So go grab that.

However, while his instructions are great for macOS users, they don’t work on Linux and moreover they don’t offer access from the shell. I write in Vim, in a tmux session, so I wanted an easy way to look things up without switching apps.

The answer is named sdcv. It is, in the words of its man page, “a simple, cross-platform text-based utility for working with dictionaries in StarDict format.” That last bit is key, because the Webster’s 1913 file you downloaded from Somers is in StarDict format. I installed sdcv from the Arch Community repository, but it’s in Debian and Ubuntu’s official repos as well.

Once sdcv is install you need to unzip that dictionary.zip file you should have grabbed from Somers’ post. That will give you four files. All we need to do now is move them somewhere sdcv can find them. By default that’s $(XDG_DATA_HOME)/stardict/dic, although you can customize that by add thing Environment variable STARDICT_DATA_DIR to your .bashrc. I keep my dictionaries in ~/bin/dict folder so I just drop this in .bashrc:

STARDICT_DATA_DIR="$HOME/bin/dict/

How to Lookup Words in Webster’s 1913 from the Command Line

To use your new one true dictionary, all you need to do is type sdcv and the word you’d like to look up. Add a leading ‘/’ before the word and sdcv will use a fuzzy search algorithm, which is handy if you’re unsure of the spelling. Search strings can use ? and * for regex searching. I have never used either.

My use is very simple. I wrote a little Bash function that looks like this:

function d() {
    sdcv "$1" | less
}

With this I type d search_term and get a paged view of the Webster’s 1913 entry for that word. Since I always write in a tmux split, I just move my cursor to the blank split, type my search term and I can page through and read it while considering the context in the document in front of me.

But I Want a GUI

Check out StarDict, there are versions for Linux, Windows, and macOS, as well as source code.