// If the term is to be processed using fewer than all of its contexts,
// then randomly select the maximum allowable contexts from the matrix
if (maxContextsPerWord < Integer.MAX_VALUE &&
contextsForCurTerm.rows() > maxContextsPerWord) {
BitSet randomContexts = Statistics.randomDistribution(
maxContextsPerWord, contextsForCurTerm.rows());
contextsForCurTerm =
new SparseRowMaskedMatrix(contextsForCurTerm, randomContexts);
}
return contextsForCurTerm;