use of io.anserini.search.SearchCollection in project Anserini by castorini.
the class EndToEndTest method testSearching.
@Test
public void testSearching() {
// Subclasses will override this method and provide the ground truth.
setSearchGroundTruth();
try {
for (Map.Entry<String, SearchArgs> entry : testQueries.entrySet()) {
SearchCollection searcher = new SearchCollection(entry.getValue());
searcher.runTopics();
Map<String, List<String>> actualQuery = searcher.getQueries();
searcher.close();
// check query tokens
if (!queryTokens.isEmpty()) {
assertEquals(queryTokens, actualQuery);
}
checkRankingResults(entry.getKey(), entry.getValue().output);
// Remember to cleanup run files.
cleanup.add(new File(entry.getValue().output));
}
} catch (Exception e) {
System.out.println("Test Searching failed: ");
e.printStackTrace();
fail();
}
}
Aggregations