| 1 | # Homework 2 part 3
|
| 2 | # David Wallace
|
| 3 |
|
| 4 | # A module for spell checking
|
| 5 |
|
| 6 | dictfile = "dict.txt"
|
| 7 |
|
| 8 | def checkword(word):
|
| 9 | """Test one word for correct spelling.
|
| 10 |
|
| 11 | If word is misspelled, return list of alternate spellings.
|
| 12 | Otherwise return empty list."""
|
| 13 | pass
|
| 14 |
|
| 15 | def checktext(text):
|
| 16 | """Test a block of text for correct spelling.
|
| 17 |
|
| 18 | Return list of tuples, each representing a misspelled word
|
| 19 | in the following format:
|
| 20 | (index_of_first_char, word, list_of_alternate_spellings)
|
| 21 |
|
| 22 | If all words are correct, return empty list."""
|
| 23 | pass
|
| 24 |
|
| 25 | def addword(word):
|
| 26 | """Add word to dictionary"""
|
| 27 | pass
|
| 28 |
|
| 29 | def removeword(word):
|
| 30 | """Remove word from dictionary"""
|
| 31 | pass
|
| 32 |
|
| 33 | def split_text_to_words(text):
|
| 34 | """Split the string 'text' into a list of words"""
|
| 35 | pass |