Handling Correctly Spelled Words
Throughout this chapter you’ve focused on building a spell checker with the assumption that most words would need to be compared against the entire dictionary to find misspellings. In reality, most words in most documents are spelled correctly, and we could avoid doing a lot of work if we identify correctly spelled words before calculating the edit distance to potential candidate corrections.
Use what you’ve learned in this chapter to update your spell checker to skip looking for corrections for words that are already spelled correctly.
Hint: Consider using the hashable
library to generate a unique identifier for
each string in your dictionary.
Hint 1
Some high level hint text
Hint 2
Some more detailed hint text
Hint 3
Even more detailed hint text
Solution
A complete solution for the exercise
Remembering Common Typos
When a user is typing a long document, it’s common that they will make certain mistakes many times. For example, a user might habitually omit particular double letters, or be prone to transposing certain letter sequences (for example typing “teh” instead of “the”). Update your spell checker to remember misspellings and their corrections, rather than doing a complete search each time the misspelling is encountered.
Hint 1
Some high level hint text
Hint 2
Some more detailed hint text
Hint 3
Even more detailed hint text
Solution
A complete solution for the exercise
Spellchecking in HCat
Use what you’ve learned in this chapter to add interactive spellchecking to the HCat application you built earlier in this book, when learning about IO
Hint 1
Some high level hint text
Hint 2
Some more detailed hint text
Hint 3
Even more detailed hint text
Solution
A complete solution for the exercise