Pair counter
Words: to be to be
Most common: ('to', 'be') 2
Each adjacent pair becomes a tuple like ('to','be'). Tuples can be dictionary keys because they are immutable.
Because tuples are immutable, they can be dictionary keys. Lists cannot.
From words w0 w1 w2 ..., make pairs (w0,w1), (w1,w2), .... Count which pair appears most.
Autocomplete, spam filters, and language models all look at which words follow which other words.
Words: to be to be