July 2023
Intermediate to advanced
670 pages
17h 13m
English
Throughout this chapter, you’ve focused on building a spellchecker with the assumption 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 spellchecker 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.
When a user is typing a long document, ...
Read now
Unlock full access