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.” :roll:

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. … :)

About these ads

6 Responses to “A console spellchecker and dictionary”


  1. 1 quigybo 2010/04/12 at 8:07 PM

    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. 2 urukrama 2010/04/13 at 2:54 AM

    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.

    http://sdcv.sourceforge.net/

    • 3 urukrama 2010/04/13 at 2:56 AM

      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. 4 eric 2010/05/05 at 10:44 PM

    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.


  1. 1 Links 12/4/2010: Awn 0.4.0, VP8 Becoming Free Software | Techrights Trackback on 2010/04/13 at 7:25 AM
  2. 2 A console goodie grab bag « Motho ke motho ka botho Trackback on 2010/10/03 at 8:15 AM

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,959,782 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: