If you have a query file that can not be read by one of the current topic reader then you can add a new one by your own.
The detailed steps are:
- Add a new class under package
io.anserini.search.query
. This class should extends TopicReader class. The name should be something like MyOwnTopicReader where MyOwn is the name of your collection class. The class will be instanced asTopicReader tr = (TopicReader)Class.forName("io.anserini.search.query."+searchArgs.topicReader+"TopicReader") .getConstructor(Path.class).newInstance(topicsFile);
- Implement
read
function so that a sorted map of{query id : query string}
is returned by reading the query file.
Please take a look at TopicReader for full example.