in reply to Spell Check
(Now the perl wizards will trounce this code, but I'll post it anyways in hopes of learning from them.)$dictfile="/some/path/to/dictfile"; #Dictfile should have a all words (or regex for words), one per line open (DICT, $dictfile) or die "Can't open $dictfile:$!"; while(<DICT>){ $words{lc($_)}=1; #using hash as cheap lookup #Note that a "real" dictionary file will nail you on efficency her +e. Perhaps a Dbm would be better? } while(<>){ foreach $word (split($_)){ if (!defined($words{lc($word)})){ print "$.:$word?\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Spell Check
by perlcgi (Hermit) on May 30, 2000 at 19:40 UTC |