A class for extracting n-grams from text