takes varying n-gram length