functions for trigrams and digitFractions