Skip to content

Commit

Permalink
Fix path parsing error with SearchCollection when searching MSMARCO V1(
Browse files Browse the repository at this point in the history
…castorini#2099)

This bug is a carry-over from previous offloading topics-and-qrels commits
  • Loading branch information
ArthurChen189 authored Apr 11, 2023
1 parent 467ac5a commit ca6b285
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/anserini/search/SearchCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,9 @@ public void run() {
try {
InputStream inputStream = null;
if (isMSMARCOv1_passage) {
inputStream = TopicReader.class.getClassLoader().getResourceAsStream(Topics.MSMARCO_PASSAGE_DEV_SUBSET.path);
inputStream = Files.newInputStream(TopicReader.getTopicPath(Path.of(Topics.MSMARCO_PASSAGE_DEV_SUBSET.path)), StandardOpenOption.READ);
} else {
inputStream = TopicReader.class.getClassLoader().getResourceAsStream(Topics.MSMARCO_DOC_DEV.path);
inputStream = Files.newInputStream(TopicReader.getTopicPath(Path.of(Topics.MSMARCO_DOC_DEV.path)), StandardOpenOption.READ);
}

BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static Path getNewTopicsAbsPath(Path topicPath){
* @return
* @throws IOException
*/
private static Path getTopicPath(Path topicPath) throws IOException{
public static Path getTopicPath(Path topicPath) throws IOException{
if (!TOPIC_FILE_TO_TYPE.containsKey(topicPath.getFileName().toString())) {
// If the topic file is not in the list of known topics, we assume it is a local file.
Path tempPath = Paths.get(getCacheDir(), topicPath.getFileName().toString());
Expand Down

0 comments on commit ca6b285

Please sign in to comment.