public void map(IntWritable docno, WeightedIntDocVector docvector,
OutputCollector<IntWritable, PairOfFloatInt> output, Reporter reporter) throws IOException {
for (int i = 0; i < vectors.size(); i++) {
IntWritable sampleDocno = (IntWritable) vectors.get(i).getLeftElement();
WeightedIntDocVector fromSample = (WeightedIntDocVector) vectors.get(i).getRightElement();
float cs = CLIRUtils.cosine(docvector.getWeightedTerms(), fromSample.getWeightedTerms());
if (cs >= threshold) {
output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(cs, docno.get()));
}
}