in reply to Spell Check

There is the Text::Ispell module from CPAN.

If you have a dictionary file (like /usr/dict/words under UNIX) it is easy to write a simple misspelling-detector in perl:

my %dict; open D,"</usr/dict/words"; while(<D>){ chomp; $dict{lc($_)}=$_; } close D; my $text='Is there anyway to write a spell checker in perl?? Please he +lp.'; my @words=split /[^a-zA-Z0-9']+/,$text; foreach (@words){ if(!defined $dict{lc($_)}){ print "\"$_\" is not in the dictionary\n"; } }
This could be enhanced significantly, but will get you started on the right path.

Replies are listed 'Best First'.
Re: Re: Spell Check
by jdporter (Paladin) on Jun 30, 2003 at 20:45 UTC
    Nota Bene! You should be using Lingua::Ispell, not Text::Ispell.

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.