If you have a dictionary file (like /usr/dict/words under UNIX) it is easy to write a simple misspelling-detector in perl:
This could be enhanced significantly, but will get you started on the right path.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"; } }
In reply to Re: Spell Check
by lhoward
in thread Spell Check
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |