06/21/2009, 05:34 PM
EDIT: There are a few autoreplace list links in this post, but this is the one you want: http://drop.io/dimfeld/asset/autoreplace-common-zip
I spent the last few hours working on an upgrade to the autoreplace system. I found that when typing on the Pre, most of my typing mistakes would come from pressing the key either to the left or the right of the correct key. Personally, I never have a problem with hitting the wrong row, so that makes things somewhat simpler.
I wrote a Python script to read in a word list file (I used a standard Mac OSX word list with contractions added) and generate all the possible single-letter mistakes from that file that could result from pressing the button to the left or right of the intended button. This script also reads in the Pre's autoreplace file, and it gives precedence to the corrections in there. To keep the output file to a reasonable size, I didn't do corrections for words more than 7 letters long. With this restriction, the file is 9MB, and with a max length of 9 letters, it's 27MB.
I've uploaded the Python script, my modified word list, and the resulting output file at [removed because it's outdated]
I haven't included the Pre's autoreplace file here to avoid any IP concerns, but if you can get the replacement file in to the Pre, I'm sure you can get the original out
EDIT: The original file here causes Webkit to use a lot of memory and load slowly. I've uploaded a new file with words only up to 5 characters long at http://drop.io/dimfeld/asset/autoreplace5-zip which seems to work much better.
EDIT2: And here's another file with a word list generated from a list of the 15000 most common English words. I recommend using this one as it also has other improvements. See posts #21 through #24 for more details. http://drop.io/dimfeld/asset/autoreplace-common-zip
To run the script:
python generate_autoreplace.py original-autoreplace wordlist new-autoreplace
Upload the output file to
Then reboot your Pre and you're all set.
I haven't done extensive testing on this, so do this at your own risk, but it's working well for me so far.