Here you can find the source of saveTrecOneEntry(BufferedWriter trecFile, String topicId, String docId, int docPos, float score, String runId)
Parameter | Description |
---|---|
trecFile | an object used to write to the output file. |
topicId | a question ID. |
docId | a document ID of the retrieved document. |
docPos | a position in the result set (the smaller the better). |
score | a score of the document in the result set. |
runId | a run ID. |
Parameter | Description |
---|---|
IOException | an exception |
private static void saveTrecOneEntry(BufferedWriter trecFile, String topicId, String docId, int docPos, float score, String runId) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.IOException; public class Main { protected static final String NL = System.getProperty("line.separator"); /**/*from w w w. j ava2s . com*/ * Save positions, scores, etc information for a single retrieved documents. * * @param trecFile an object used to write to the output file. * @param topicId a question ID. * @param docId a document ID of the retrieved document. * @param docPos a position in the result set (the smaller the better). * @param score a score of the document in the result set. * @param runId a run ID. * @throws IOException */ private static void saveTrecOneEntry(BufferedWriter trecFile, String topicId, String docId, int docPos, float score, String runId) throws IOException { trecFile.write(String.format("%s\tQ0\t%s\t%d\t%f\t%s%s", topicId, docId, docPos, score, runId, NL)); } }