Tag Archives: check

checkmp3: Does exactly that

A long time ago I mentioned mp3check, and we also saw mpck and mp3val. checkmp3 does much the same thing as those tools, albeit with a little less … discussion.

2014-10-04-l3-b7175-checkmp3

checkmp3 adds on the oblique ability to “fix” mp3 files, by sending the entire file to STDOUT but omitting frames which appear invalid. I suppose that could technically “fix” an mp3 if you pipe it into another file, but I also suspect it would cause hiccups in some cases. The files I used for a test run were more or less intact, so I didn’t notice any difference in playback.

You see the Debian Squeeze version there (apparently it’s also in Sid), but the man page gives a Sourceforge address which is titled, oddly, MP3 Check. I tried building MP3 Check from scratch in Arch but ran into issues; all the same, I have no reason to believe that checkmp3 and MP3 Check are not the same program. (The mp3check we saw before was strikingly different.)

That’s about all I can think of to say. It’s a very straightforward tool and (apparently) does what it promises. Let’s move on.

sha* (with sha1pass and shasum): Sha-sha-sha

I mentioned md5sum a long, long time ago, and now I feel obligated to include the sha* suite. I think this might be where the free ride ends for checksum generators though. Here’s why:

2014-09-18-6m47421-sha256sum

That’s it, that’s basically all it does. Of course, it’s not like md5sum did much more. You can use this in much the same way as md5sum — checking file integrity where the publisher has a sum available to match, or as a fingerprinting utility where there was an intermediary in the transfer.

I wanted to point out that the sha* binaries are part of coreutils, but my Arch system has two other sha* programs: sha1pass, installed as part of syslinux, and shasum, which came with perl.

I can’t speak for either of those last programs, since I’m not sure what their original intent was. I have a feeling sha1pass works with passwords and encryption, while shasum appears to be a frontend for the sha* binaries. If you use sha* enough, shasum might be helpful.

But that’s why I said the gravy train might be pulling into the station for checksum generators: They have a very slim and specific function. And what I’ve seen of a few other checksum generators suggests that’s all they’re meant to do. :\

style: Similar idea, different direction

Both diction and style are components in the same GNU package, and that’s a little surprising since they obviously do quite different things.

2014-09-17-6m47421-style

I fed style the same passage as I did diction, but rather than pluck out problematic words or phrases, style gives a technical and statistical analysis of the text. So no specific grammatical warnings, aside from a tally of how many conjunctions I used — oops, I mean, the writer used. 🙄

However, unless you’re familiar with those tests, the scores listed there are unlikely to mean anything to you. I’ll give you this as a starting link, and from there you can explore on your own. Each test has its own metric, and it may be that just word structure or even number of syllables can swing results in one direction or another.

Actual computation aside, style works in a very fast, very clean manner and presents its results in a useful table. Options-wise, style has flags for specific grammatical structures or voices, plus some triggers for sentence length or certain test results. If you want to screen out sentences more than 20 words long, for example, style is your tool.

So again, style is not so much a grammar checker as it is a writing analyzer, with the added ability to pop out lines that meet certain criteria. Kind of a like a grammar-grep, I guess.

I can’t necessarily endorse either diction or style as must-have tools if you do a lot of writing at the console, or even if you just do a lot of writing. They’re helpful, but might seem primitive compared with some conventional, contemporary applications. Keep them in mind though.

In the mean time, send me a link when you finish your text-based user interface grammar checker utility. The world awaits the arrival of your genius. 😉

diction: The words you choose and why

Earlier this month I pointed out a grammar checker utility that was, because of its age and its arrangement, omitted from this daily showcase of software. And I felt a little bad about that because as far as I can tell, it was the only grammar checker for a text-only environment that I’ve seen in 21 months.

There are two conclusions to be drawn from that: One, that relying on outside sources as a core component of your software might make it obsolete before its time. And two, if you’re a budding programmer looking to make your mark on the world, there’s a big open gap right around text-based grammar checkers.

If you want to take a step in that direction, take a gander at diction.

2014-09-17-6m47421-diction

In that example, I fed diction a short and cumbersome passage from some lunkhead-Linux-blogger-wannabe I found on the Internet. 😉 And if you look close, you can see where diction plucks out particular words and phrases, and gives you reminders — sometimes grammatical — on usage.

Not really a grammar checker, and not really a dictionary, which makes diction something in-between.

Points of note: diction is really just a filter for specific words and phrases, with cued responses inserted where appropriate. That’s important to remember, since rearranging or misspelling those key phrases is going to let diction pass right over them.

Furthermore, diction is hopeless at innuendo, double-entendre, turns of phrase or deliberate wordplay. If it’s not in the onboard repertoire, diction will either run right past it or flag it as some sort of unrelated error. So higher-order writing is susceptible to false positives.

The only other gripe I have is that the output is particularly dense. No color filtering, no line-by-line trapping, no formatting aside from the use of square brackets to set off comments from original text. So while I appreciate the effort diction goes through, the results are going to need some heavy adjustment before they will be readable.

All that being said, this is a step in the right direction for anyone who wants to do some text wrangling from the command line. diction sends its analysis straight back through STDOUT, so it’s a simple matter to pipe it into something else — like one of the million color filtering tools we’ve seen — and further adjust it.

Now let’s move to diction’s little brother. …

linkchecker: Relax your mouse clicker finger

I seem to be on an Internet-based kick these days. It started yesterday with httpry and html-xml-utils; now I’m on to linkchecker, which cascades through pages or sites and checks that the links are … linking.

2014-09-12-6m47421-linkchecker

linkchecker came at a good time, since I got an e-mail a week or so ago, mentioning (not really complaining, just mentioning) that most of the software I touch on seems to have been around for quite a while. The suggestion was, “When are you going to show us some fresh stuff?”

Well, linkchecker has updates within the past few days, and I’d bet wummel is working on it even as you’re reading this. How’s that for fresh? 😈

What linkchecker does and how is probably obvious just from the name, without looking at the screenshot. And of course, you should probably be careful where you aim linkchecker, because as you can see, it had stacked up several thousand links to check within only a minute or two of looking at this page.

Perhaps it would be better kept in-house first, before turning it loose in the wild. 😐

linkchecker has a long, long list of options for you to look over, in case you want to check external URLs (gasp!), use customized configuration files or filter out URLs by regex. Or a lot of other things.

Perhaps the greatest part about using linkchecker though, is that it allows you to relax your mouse clicker finger, and do other things. Interns everywhere will rejoice. 😉

And just for the record, without any snarky undertones, I do have a tendency to pull in a lot of old, or outdated software. If it still works, I’m still willing to use it. I hope you feel the same. 😕

hunspell: A spellchecker with vast dictionary support

I see an occasional spellchecker around here — there was aspell and ispell a long while back, look was another one. codespell was good for picking through code for spelling errors, and I guess in an offhand way, dict is a spellchecker. Here’s a great one for stepping through a document and picking out errors: hunspell.

2014-08-23-6m47421-hunspell

hunspell was already installed on my Arch system, as a dependency to a dependency to a dependency to Pidgin. I see that it’s also optional for a lot of other programs, like Pale Moon or even re-alpine. Which I suppose, is a testament to its usefulness.

In its console interface, hunspell shows the possible error in context, alongside a list of suggested replacements. Key in the number of your correction, or use one of the other options to replace or ignore the error. Reach the end of the document, and you have the option to save. Easy as that.

It’s very sparse, but then again, it’s a tried-and-tested formula. Text-based spellcheckers have been around since the 1970s, if not earlier. We’re working with the benefit of experience here. … 😉

Besides the obvious “no color” complaint, I can’t find anything that is a detriment to hunspell. Like I said, my Arch installation had hunspell installed already, but I needed to install the English dictionary before it would work directly on a text file.

And that might be part of hunspell’s greatest asset: An immense number of dictionaries. I doubt that list is complete; add to that the number of LibreOffice and Mozilla extensions that the home page implies. Plus MySpell dictionaries. And Android and Abiword support.

I’m drifting off-target again though. My real desire here was to show you the terminal interface, and point out that it’s a very real possibility that you’ve already got it on your system. Install a dictionary, and hunspell is ready to roll.

Now I had better go over this post one more time, to make sure I didn’t commit any errors in here. … 😐

codespell: Prevents embarrassing code

Today is Pick on Kernel Developers’ Spelling Abilities Day.

2014-07-31-lv-c5551-codespell

As if they didn’t have enough work to do, along comes me and codespell to harass them about their spelling mistakes. :\

Spelling is sometimes important though, so a spellchecker specific to code is probably a good idea. And since I have no ability when it comes to creating software, I have to have something to complain about. O_o

codespell is neat stuff, and I don’t say that just because it has a lot of color in it. For one thing, you can step through a folder of code word-by-word, and codespell will give you the chance to correct things interactively.

2014-07-31-lv-c5551-codespell-corrx

Aside from that, codespell can write corrections directly into files, print a summary of the changes it suggested, and access custom dictionaries. There are quite a few other options, include one to — gasp! — strip out all that lovely color.

As I understand it, codespell’s main reference is part of the release, but is derived from Wikipedia’s page of common misspellings for machines (and-or technology).

If you really want to put codespell through its paces, I would suggest matching it head-to-head against something like aspell (or ispell or …). The difficulty in that, of course, is that aspell (or ispell or …) is likely to stumble over any portion of code that doesn’t look like a standard English (or other language) word. Which means codespell might end up saving you time.

And now for my regularly scheduled pity party, where I insist I would make much more use of codespell if I had a stick of programming ability. I’ll spare you that this time; if I had spent a tenth of the time learning to write software as I have moaning about my inability, I’d have come up with something vaguely usable by now. 🙄