You already know the four steps inside the autocorrect model, so it's time to look at each step in detail. You'll be implementing each of these steps in this week's assignments. Step 1, identify a misspelled word. When the string deah is encountered, how do you know it's a misspelled word? Well, if it's spelled correctly, you'll find it in a dictionary, if not, then it's probably a misspelled word. If a word is not given in a dictionary, flag it for correction. Recall that you're not searching for contextual errors, just spelling errors. There are much more sophisticated techniques for identifying words that are probably incorrect by looking at the word surrounding them, some of which you will visit later in the course. But for now, quickly identifying a word as incorrect by its apparent misspelling is a simple yet powerful model that works well. So words like deer will pass through this filter just fine, as it is spelled correctly, regardless of how the context may seem. Step 2, find strings that are one, two, three, or any number n edit distance away. When saying n edit distance, I'm referring to an edit distance of n, such as at the distance of one, at a distance of two, and so on. An edit is a type of operation performed on a string to change it into another string. And edit distance counts the number of these are operations, so that the n edit distance tells you how many operations away one string is from another. Now consider an insert operation, for example. This is a type of edit that adds a letter to a string in any position. For example, starting with the word to, insert a p at the end and you get top, or insert w in the middle and you get two. A delete operation removes a letter. For example, start with the word hat, delete t from the end and you get ha, or delete a from the front and you get at. Or delete a from the middle and you get the string ht. A switch edit swaps two adjacent letters, for example, the string eta. Switch t and a and you get eat, or switch e and t and get tea. Notice that you are switching two letters that are next to each other. So this does not include switching two letters that are not next to each other, such as switching the e and the a to make ate. A replace edit changes one letter to another, for example the word jaw. Change w to r and you get jar, or change j to p and you get paw. So using the four edits, insert, delete, switch, and replace, you can modify any string. And by combining these edits, you can find a list of all possible strings that are n edits away. For autocorrect, n is usually one to three edits. You'll implement each of these edits in this week's programming exercise, and combine edits to get a list of two edit distances from the original input string. Now Step 3, filter candidates. Notice how many of the strings that are generated do not look like actual words. To filter these strings and keep ones that are real words, you only want to consider real and correctly spelled words from your candidate lists. So again, compare it to a known dictionary or vocabulary, just like in Step 1. This time, if the string does not appear in the dictionary, remove it from the list of candidates. When you're left with a list of actual words only, then that is good progress. That's the first three steps of building the autocorrect model. In the next lesson, you'll see the fourth and final step.