The algorithm used was The Katz Backoff Model. This model will predict the probability of a word being the next one chosen by a user inputting text by comparing what has already been entered against a set of ngrams - quadgrams, trigrams, and bigrams.
If a match is not found by comparing a four word phrase to a set of quadgrams, the last three words of user input would then be used against a set of trigrams, and so on, in essence "backing off" until an appropriate next word prediction is found.
The entire code base for this project, with details about the algorithm implementation, can be found in my github repository: https://github.com/eileen98034/Capstone