Letter insertion generates strings by placing one possible letter at every position in an existing string. In spelling suggestions, this tests whether a missing letter caused the misspelling. section 7.3
A spelling-suggestion process treats insertion as one of three single-letter edits:
- Try every alphabet letter in every position, including letters already present. section 7.3
- Keep only generated strings that occur in the collection of correctly spelled words. section 7.3
- Separate insertion from deleting and changing letters, then combine the subtasks in a larger candidate-generation function. section 7.5.2
Repairing a missing letter
Adding c to sucessful in the appropriate position produces successful. Adding c in other positions produces candidates such as scucessful, which can be rejected when they are not real words. section 7.3
Table 7.2 Examples of the add_letter, delete_letter, and change_letter function
|
Input String
|
Strings Returned by
add_letter
|
Strings Returned by
delete_letter
|
Strings Returned by
change_letter
|
|---|---|---|---|
cu
|
acu, bcu, ccu, …, zcu cau, cbu, ccu, …, czu cua, cub, cuc, …, cuz
|
u, c
|
au, bu, du, …, zu, ca, cb, cc, …, cz
|
cad
|
acad, bcad, ccad, …, zcad caad, cbad, ccad, …, czad caad, cabd, cacd, …, cazd cada, cadb, cadc, …, cadz
|
ad, cd, ca
|
aad, bad, dad, …, za cbd, ccd, cdd, …, czd caa, cab, cac, …, caz
|
Compare add_letter with deletion and replacement across short input strings such as cu and cad. section 7.5.2
