Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which topicreader to use when my query id is string (like q123) instead of int (123)? #1946

Closed
namespace-Pt opened this issue Jul 31, 2022 · 0 comments

Comments

@namespace-Pt
Copy link

My queries are formatted like this:

q123    this is a query

where the query id q123 and the query content is separated with a \t. I used to use -topicreader TsvInt to read queires whose id can be converted to integer. However, it fails on the aforementioned query format, triggering the following error:

java.lang.NumberFormatException: For input string: "q123"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.base/java.lang.Integer.parseInt(Integer.java:652)
        at java.base/java.lang.Integer.valueOf(Integer.java:983)
        at io.anserini.search.topicreader.TsvIntTopicReader.read(TsvIntTopicReader.java:56)
        at io.anserini.search.topicreader.TopicReader.read(TopicReader.java:97)
        at io.anserini.search.SearchCollection.runTopics(SearchCollection.java:574)
        at io.anserini.search.SearchCollection.main(SearchCollection.java:794)
Exception in thread "main" java.lang.IllegalArgumentException: Unable to load topic reader: TsvInt
        at io.anserini.search.SearchCollection.runTopics(SearchCollection.java:577)
        at io.anserini.search.SearchCollection.main(SearchCollection.java:794)

I think the error is because q123 cannot be parsed into integer. So what is the proper topicreader to use when my query id is a unique string?

@castorini castorini locked and limited conversation to collaborators Jul 31, 2022
@lintool lintool converted this issue into discussion #1948 Jul 31, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant