Local n-grams