Auto Correct (or QuickCorrect in WordPerfect terminology) is a feature which is commonly found in many programs which need to provide text data entry quality and speed (eg. MS Word/Excel, OpenOffice/Libre Office's Writer etc. and (almost) all smartphones today ) and consists in automatically changing pieces of text, process which is based on a custom two-column lookup table. One can read more about on Wikipedia, also we can provide the algorithm and the code for this.
We will use this as an speed enhancement (first) and corrector (second) for the Auto Complete engine for Keywords, Renaming Directories and in Move / Copy dialogs.
With this feature, we can have shortcuts like...
- 'ny' for New Orleans (because it is big)
- 'ms' for Marseille (because we don't know how it is written exactly in order to search it)
- 'pg' for Pierre Gougelet
(because there are many people named 'Pierre', because we don't know exactly how it is written, because it is a rather big name and because we love him
)
- 'mit' for Massachusetts Institute of Technology (because it is obvious why)
- We will not support any formatting. The 'engine' will be a simple array/list/table with two columns of text (strings)
- All searches will be case INsensitive (hence 'mit' = 'MIT')
- Upon installation the Auto Correct will be empty. This is very important (and surprisingly) powerful because in this way, we will avoid the unintended 'corrections'. Let us remember that we're here in a Controlled Vocabulary environment.
- The auto correct lookup will be triggered by any key smaller than 'A' (Capital A - which is the first letter). Hence at every key press we will read the last word (we will take the word by scanning backwards till the prev. char smaller than 'A') and look if it is in the table. If yes, put the replacement.