If your Android keyboard keeps dying ...
Try to empty the app data and cache for the AOSP keyboard app as well as for the dictionary app. Mostly this happens because the dictionary experienced a learning hiccup.
You can find the app data in
system settings > apps > AOSP keyboard
system settings > apps > dictionary[foo]