Benjamin Kemp
December 13, 2014
A simple text prediction engine.
This simple, but effective, text prediction engine takes the word or phrase entered by the user, predicts what the next word will be then presents the predicted word to the user.
The last five words entered by the user are separated. “Once upon a time there” becomes: “Once”, “upon”, “a”, “time”.
A list is then created starting with all of the words, then by dropping the first word, then the second word, etc. The last word in the list is used as a keyword in Part 2.
For example:
This list is then used to generate search queries to a locally stored dabase derived from millions of Twitter tweets, blog posts, and news articles.
The queries are sorted by highest frequency of occurance in the database and return one result. The results are parsed for the keyword and the word which follows it is stored. This list is aggregated and the word with the highest frequency of occurance, weighted by the number of words used in the query, is returned to the user.
Using this app is easy! Simply enter a word or phrase in the text box…