help need to write a python spell checker

H

harry k

Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary.


The program will accept either one or two command line parameters.
1. The first command line parameter is the name of the text file that will be checked.
2. The optional second command line parameter is the name of the dictionary file – a file of words with one word per line. The default dictionary file is ref.txt.
The program will write out the misspelled words, one per line, in alphabetical order.

Extend the spell checking tool so that as well as identifying all misspelled words, the program will list the line numbers in the file where the incorrect spelling occurs.

The program will write out the misspelled words (one per line, in alphabetical order), followed by a tab character, followed by the list of line numbers that word is misspelled in,in ascending order, on the same line, separated by a single space.


Extend the spell-checking tool so that the program will also print out a list of possible correct spellings for the words.

The program will write out the misspelled words (one per line, in alphabetic order), followed (on the same line) by a single space, followed by the list of line numbers in ascending order, each separated by a single space, followed by a single space, then the list of possible correct spellings, each separated by a single space.

Find the alternate spellings by considering:
a. Words in the dictionary that are the same length but:
a. Have a pair of characters interchanged
b. Differ by one character from the misspelled word
b. Words that are one character longer or one character shorter, but otherwise match the misspelled word.
 
P

Patrick Maupin

Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary.

Well, this has been educational. Both my daughters just finished
their final exams last week, so I was confused about seeing the
homework assignment. Then I saw the email address. Although it makes
perfect sense, I never really thought much about the possibility that
the school year would be "upside down" "down under"...

Regards,
Pat
 
A

alex23

Patrick Maupin said:
Although it makes
perfect sense, I never really thought much about the possibility that
the school year would be "upside down" "down under"...

Yes, having the school year run within the actual year instead of
across two is such a topsy-turvy concept, it's pretty obvious the
blood is constantly rushing to our heads ;)
 
A

Albert van der Horst

Yeah, that way he did not mess it up ;-).

OTOH it may be a copyright infringement. Or is posting an assignment to a
newsgroup "fair use"?

Groetjes Albert
 
Joined
May 23, 2010
Messages
1
Reaction score
0
It's funny, because i'm part of this course, i've finished my own spellchecker, and i just saw this on google.

Should i email the course coordinator with a link to this? ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top