int[][] termPositions = new int[cliques.size()][];
int doclen = -1;
for (int i = 0; i < cliques.size(); i++) {
// Current clique that we're scoring.
CascadeClique c = (CascadeClique) cliques.get(i);
if (firstTime) {
termToCliqueNumber.put(c.getConcept().trim().toLowerCase(), i);
cf.put(c.getConcept().trim().toLowerCase(), c.termCollectionCF());
df.put(c.getConcept().trim().toLowerCase(), c.termCollectionDF());
}
if (score + docMaxScore <= scoreThreshold) {
// Advance postings readers (but don't score).
for (int j = i; j < cliques.size(); j++) {
cliques.get(j).setNextCandidate(docno + 1);
}
skipped = true;
break;
}
// Document independent cliques do not affect the ranking.
if (!c.isDocDependent()) {
continue;
}
// Update document score.
float cliqueScore = c.getPotential();
score += c.getWeight() * cliqueScore;
// Update the max score for the rest of the cliques.
docMaxScore -= c.getMaxScore();
// stuff needed for document evaluation in the next stage
int[] p = c.getPositions();
if (p != null) {
termPositions[i] = Arrays.copyOf(p, p.length);
doclen = c.getDocLen();
}
}
firstTime = false;