aha, great job. I had been thinking about doing something similar (my own source of inspiration being sh/bash tab autocompletion).
On a similar note : i've just given a look at Reed's Poor Man's Mistype extension. I haven't checked the source-code but from what the doc says :
This extension tries to fix spelling errors in misunderstood input by looking for words in the "printed name" of nearby objects that start with the first three letters of the first misunderstood word in the player's input. While a simple approach, this still catches about 40% of IF typos, including common cases where the player uses an abbreviated form or a unimplemented plural or singular form of a noun.
i think he didn't choose the right heuristic.
Recently i've been learning a couple stuffs about auto-correction algorithms:
•around 90% of mistypes are caused by mistyping only one character.
•Subsequently, auto-correction can be done easily. One technique relies in creating a confusion matrix on the basis of a word list (ie a database of mistyped words) in order to guess the closest word. It has the advantage of being extremely fast and can be written in less than 50 lines of code. Candidate words having the minimal edit score/distance among a set of candidates can be discriminated further from each other by looking at other factors like their lexical (either surface-based or stem-based) frequency.
Since we're talking about IF, I think the system should take into account the objects proximity, and whether the candidate word is the printed name of an existing object or not.
I'll try to smurch out something in this vein (for now i HAVE to finish another obj-c project), first using that single-character mistype auto-correction algorithm but I doubt it is appropriate for the iPhone (since a smaller keyboard leads to a greater number of mistypes per misspelling (differentiating the articulatory level (in this case, "misproducing" letters) from the lexical level))).