public class TopNJudgmentExtractor implements PseudoJudgmentExtractor {
private static int n = 10;
@Override
public PseudoJudgments getPseudoJudgments(ArrayListWritable<AnchorTextTarget> anchorTextTargets) {
PseudoJudgments judgments = new PseudoJudgments();
int i = 0;
for(AnchorTextTarget a : anchorTextTargets) {
if(i == n) {
break;
}
judgments.add(a.getTarget(), a.getWeight());
i++;
}
return judgments;
}