static PosNegMatrix posNegMatrixForNGrams(Cl posNgrams, Cl negNGrams, Cl pos, Cl neg) { PosNegMatrix matrix = posNegMatrixOfLists(); for (S s : pos) { int score = substringsScoreICPosNeg(s, posNgrams, negNGrams); bool ok = score > 0; (ok ? matrix.pos : matrix.falseNeg).add(s); } for (S s : neg) { int score = substringsScoreICPosNeg(s, posNgrams, negNGrams); bool ok = score < 0; (ok ? matrix.neg : matrix.falsePos).add(s); } ret matrix; }