use of twitter4j.JSONArray in project Anserini by castorini.
the class TopicPoller method writeTRECTopicToDisk.
public static void writeTRECTopicToDisk(TRECTopic trecTopic) throws JSONException, IOException {
// TODO Auto-generated method stub
JSONObject obj = new JSONObject();
obj.put("index", trecTopic.topid);
obj.put("query", trecTopic.title);
obj.put("narr", trecTopic.narrative);
obj.put("desc", trecTopic.description);
/*
* It is at participants' discretion on how to utilize the interest profile
* and implement proper query expansion module
*/
obj.put("expansion", new JSONArray());
try (FileWriter topicFile = new FileWriter(TRECSearcher.interestProfilePath + trecTopic.topid + ".json")) {
topicFile.write(obj.toString());
LOG.info("Successfully wrote interest profile " + trecTopic.topid + " to disk.");
topicFile.close();
}
}
Aggregations