The text prediction algorithm uses backoff method to recommend the next word. Because of app space, only 4,3,2, and 1 grams were used.
The backoff method recommends highest ranking gram with the highest frequency.
If no higher gram is observed, the next highest is computed until no Ngram is found. Then a unigram is selected at random from the top 20 most frequent unigrams.
The output is a table of the top 5 most probable predictions.
