faster trigrams pycode