remove infrequent words: add max dictionary size