Cool ! At some point, you could also consider building an index: retrieve "possible candidate corrections" by issuing a query against this index, and score the candidates using some combination of features (such as edit distance, phonetic similarity etc).