Machine Learning.
to state B. Image credits : SwiftKey Keyboard Let’s take an example : The next word suggested by Swift Keyboard as we type along leverages Markov Chain models to predict the next word based on the word we just typed in. Even Google uses Markov models in it’s PageRank algorithm to score every page