A console spellchecker and dictionary

My list of stuff to write about seems to get longer and longer every day, instead of shorter and shorter. I just got done explaining four console “tools” that lack real interfaces but are still useful, and I could probably come up with three or four more posts similar to that.

But two things that I have failed to mention for quite a long time now — in fact, three things — are a dictionary and spellchecker for the console. If you write as much as I do, those two things are important, and not wisely left out. 😦

In my case I needed two things that would work well with charm, because that’s where I do all my dirty work. 😉 For a dictionary, the dictd package works perfectly.

dict sends its results to stdout, so I can pipe that into a text file if I want, or directly into vim. The real value (for me, at least) is in the thesaurus; I can’t tell you how many times a day I’m trying to hunt down a word that means something like “this,” but not quite “this.” 🙄

What you see running there is actually an earlier version of dict (1.10.0 to be exact), because the newer versions pick up a dependency (libmaa, or something like that). I prefer to build just one package, if I have to do it at 120Mhz. 🙂

For my purposes, aspell works fantastically with charm.

I added the aspell-en English dictionary, although there are dozens available, depending on your distro. I cue aspell from the charm posting menu, and the aspell interface pops up.

Available commands are visible at the bottom of the screen, and adding a word throws it into your personal dictionary in your home folder — and that’s something you can directly edit, in case you want to add things on your own. Since most of my posts have HTML coding in them (yes, all by hand), I have already added a few words like “href” and “img,” as well as “Ubuntu” and “distro.” 🙂

charm itself will give you the option to revert from a spell-checked post, which means if you kludge something up, you can get back to your original without too much sweat. These two work particularly well together.

The last thing I wanted to show is already visible above. This is most, which is pager of considerable style, when compared with less or more.

Split windows, search functions, text marking, help page and a lot more. As you can see it makes it a lot easier to scan through different parts of a document at the same time, or compare long lists without needing two pagers running concurrently. Depends on libslang2, but that’s not a huge sacrifice.

I think that’s about it for now. I can cross three more things off my “to-write” list. … 🙂


6 thoughts on “A console spellchecker and dictionary

  1. quigybo

    I found this over at commandlinefu, tis pretty handy if you want to get the definition of a word but dont want to install anything. It uses google’s define: keyword

    define(){ local y=”$@”;curl -sA”Opera” “http://www.google.com/search?q=define:${y// /+}”|grep -Po ‘(?<=)[^/dev/null;}

  2. urukrama

    For a dictionary I use sdcv, the command-line version of StarDict. It is a great application as you can use all the dictionaries and a thesaurus you would normally use in StarDict (and there are quite a few available, in multiple languages), but have no need for any graphical front-end.


    1. urukrama

      I should add that you could even use “most” as the viewer in sdcv. Just add the following to your *shrc file:

      export SDCV_PAGER=most

  3. Pingback: Links 12/4/2010: Awn 0.4.0, VP8 Becoming Free Software | Techrights

  4. eric

    Another useful console tool, when you’re looking for a word, is ‘look’ (found in bsdmainutils on a Debian system) which gives you a list of words that start with a certain string.

  5. Pingback: A console goodie grab bag « Motho ke motho ka botho

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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