Does autocorrect take into account an alternate keyboard layout? I notice that the autocorrect in Lion uses the character positions in order to suggest which correction to be made:

For example, if I type thst really fast, it will correct it to that but if I type thet, it corrects it to they.

This makes sense on a Qwerty keyboard, since the s is by the a, and the t is next to the y. However, it wouldn't make much sense on a different layout such as Dvorak.

Does Mac OS X Lion take into account which keyboard layout you are using and offer suggestions based on keys that are nearby the typo?

What if I created an entirely new keyboard layout, and use that instead of a keyboard layout which comes with Lion?
Apple has a patent on the autocorrect feature for mobile phones (and possibly for desktops as well). There was a lawsuit over iPhone vs Samsung autocorrect: http://gizmodo.com/5884179/apple-is-now-suing-samsung-over-autocorrect
. Moving right along, apple's autocorrect does use keyboard layout to predict a replacement word: http://www.slate.com/articles/technology/technology/2010/07/yes_ill_matty_you.html . Lion will only try this feature if it can recognize the keyboard layout you are using based on a keyboard standard.