How vocab words are chosen

Hi ~
I’m trying to build a text classifier based on language model.
I’m wondering how words in vocab are chosen? are all words’ frequencies are calculated and then choose the first max_vocab words whose frequency>=min_freq? Or they calculate a word’s frequency, if >=min_freq, put it in vocab, until meet max_vocab, so if some words appear later, even if their frequency>=min_freq, they won’t be in vocab?

Pretty sure that unless you are using SPProcessor, it does this:

So it should be picking the most frequent ones.

Got it thank you!