Letter deletion generates candidate strings by removing one letter from an existing string. It helps identify spelling mistakes caused by an extra letter, such as changing “thourough” to “thorough.” section 7.3
Use the technique as one subtask in a spelling-suggestion process:
- Pass the misspelled string to a deletion function. section 7.5.2
- Loop through its letters, removing one letter at each position. section 7.5.2
- Return the resulting strings as possible candidates for comparison with real words. section 7.3
Deleting one letter
For the input “cu,” deleting one letter produces “u” and “c.” For “thourough,” deleting the first “u” produces “thorough,” a correctly spelled word. section 7.3 section 7.5.2
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 deletion with adding and changing letters through representative function outputs. section 7.5.2
