Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 987 Bytes

add-topic-reader.md

File metadata and controls

16 lines (10 loc) · 987 Bytes

Add New Topic Reader

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:

  1. 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 as TopicReader tr = (TopicReader)Class.forName("io.anserini.search.query."+searchArgs.topicReader+"TopicReader") .getConstructor(Path.class).newInstance(topicsFile);
  2. 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.