Building a search term n-gram analyzer in Python

The problem with analyzing search term reports manually: you're looking at individual queries. You can't see the patterns.