Predictive keyboard based on n-grams