Hello 
I need to write a spell checker.

I have tride to check the words in the file to be
checked against the words in the dictionary but I
havve not been able to make progress.

If I use an 
unless($word =~ /^$single_word$/i) 
    { print $single_word; do other stuff ...} 
# above prints every word of dictionary because most
words in dictionary will not match.

if ($word !~ /^$single_word$/i)
    { print $single_word; do other stuff ...}  
# same prints every word of dictionary

if($word =~ /^$single_word$/i)  
    { print $single_word; do other stuff ...} 
# prints if $word (dictionary) and $single_word
(document) match not what I want

if($word =~ /Zzz/) # end of dictioinary
   {
      print $single_word; ... do other stuff
 # the above prints out all words in the document


I have been thinking about making an array of letters
from the $single_word to be maatched againt letters of
the $words in the dictionary. but I do not know how to
strip a single character from a word to be assigned to
a $variable.


Maybe I am going about this all wrong altogether and
that it is a mistake to try to match words in the
document to those in the dictionary. I do  not know.

I can reprint out the document, print out the words
that are in the dictionary, but what I need to do is
print out the words that are not in the dictionary.

One of the problems in my veiw of the problem is that
the only one word in the dictionary will match the
word in the document and the rest will not.

A fresh Idea from outside would be very helpful




                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to