Trigram-based Markov language model, parser and generator in Python hooked to a PostgreSQL DB