If you have (or get) the GNU Aspell library, you can use Text::Aspell to locate words that would be considered typos according to the Aspell dictionary:
use strict;
use Text::Aspell;
my $suggest = ( @ARGV and $ARGV[0] eq '-s' ) ? shift : '';
my $speller = Text::Aspell->new or die "dang it\n";
while (<>) {
for my $word ( grep /^[a-z]+$/i, split ) {
next if ( $speller->check( $word )); # skip if word is in dic
+tionary
print "misspelled word: $word\n";
if ( $suggest ) {
my @suggestions = $speller->suggest( $word );
my $advice = ( @suggestions )
? join( " ", "Might be one of:", @suggestions )
: "No idea what that should be.";
print " $advice\n\n";
}
}
}
There's even a way to specify a word list of your own choice to serve as the "dictionary" -- there's some info about this in the
Text::Aspell manual.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.