public class QueryUtility extends Object
Constructor and Description |
---|
QueryUtility() |
Modifier and Type | Method and Description |
---|---|
static HMapIF |
loadCf(RetrievalEnvironment env,
HMapIV<String> parsedQueries) |
static HMapIF |
loadCf(RetrievalEnvironment env,
String queryPath)
Loads CF values for the set of terms extracted from a query file.
|
static HMapIF |
loadIdf(RetrievalEnvironment env,
HMapIV<String> parsedQueries) |
static HMapIF |
loadIdf(RetrievalEnvironment env,
String queryPath)
Loads IDF values for the set of terms extracted from a query file.
|
static HMapIV<String> |
loadQueries(com.google.common.io.InputSupplier<? extends InputStream> queryInputSupplier)
Reads a query set in an XML format as follows:
<parameters>
<query qid="Query_ID">Query Text</query>
</parameters>
|
static HMapIV<String> |
loadQueries(String queryPath)
Loads a set of queries from an input file.
|
static HMapIV<String[]> |
parseQueries(RetrievalEnvironment env,
String queryPath)
Loads and tokenizes a set of queries.
|
static HMapIV<int[]> |
queryToIntegerCode(RetrievalEnvironment env,
HMapIV<String> parsedQueries) |
static HMapIV<int[]> |
queryToIntegerCode(RetrievalEnvironment env,
String queryPath)
Reads and converts queries into their integer forms.
|
public static HMapIF loadCf(RetrievalEnvironment env, HMapIV<String> parsedQueries) throws Exception
Exception
public static HMapIF loadCf(RetrievalEnvironment env, String queryPath) throws Exception
env
- RetrievalEnvironment object associated with the indexqueryPath
- Path to the query fileException
public static HMapIF loadIdf(RetrievalEnvironment env, HMapIV<String> parsedQueries) throws Exception
Exception
public static HMapIF loadIdf(RetrievalEnvironment env, String queryPath) throws Exception
env
- RetrievalEnvironment object associated with the indexqueryPath
- Path to the query fileException
public static HMapIV<String> loadQueries(com.google.common.io.InputSupplier<? extends InputStream> queryInputSupplier) throws ParserConfigurationException, SAXException, IOException
queryInputSupplier
- An input supplier that provides the queriesParserConfigurationException
SAXException
IOException
public static HMapIV<String> loadQueries(String queryPath) throws Exception
queryPath
- Path to the query fileException
public static HMapIV<String[]> parseQueries(RetrievalEnvironment env, String queryPath) throws Exception
queryPath
- Path to the file containing the queriesException
public static HMapIV<int[]> queryToIntegerCode(RetrievalEnvironment env, HMapIV<String> parsedQueries) throws Exception
Exception
public static HMapIV<int[]> queryToIntegerCode(RetrievalEnvironment env, String queryPath) throws Exception
env
- RetrievalEnvironment object associated with the indexqueryPath
- Path to the query fileException