public class TRECResultsMatching extends Object implements Matching
queryID Q0 docno score rank label
Properties:
MetaIndex
.
If DOCID is specified, then the docnos are assumed to represent Terrier's docids, as generated by
TRECDocidOutputFormat
.Modifier and Type | Class and Description |
---|---|
static class |
TRECResultsMatching.InputFormat
The result set input format.
|
Modifier and Type | Field and Description |
---|---|
protected CollectionStatistics |
collStats
The underlying collections statistics.
|
protected int |
docid
The current read document identifier.
|
protected static String |
DSMNS
The default namespace for document score modifiers.
|
protected List<DocumentScoreModifier> |
dsms
The list of document score modifiers to be applied.
|
protected String |
filename
The TREC results filename.
|
protected TRECResultsMatching.InputFormat |
format
The input format to use when parsing document identifiers.
|
protected boolean |
found
Whether the current query was found in the results file.
|
protected Index |
index
The underlying index.
|
protected org.apache.log4j.Logger |
logger
This object's logger.
|
protected int |
maxResults
The maximum number of results to read per query.
|
protected boolean |
parseScores
Whether document scores should be parsed from the results file.
|
protected String |
qid
The current query id.
|
protected BufferedReader |
reader
The TREC results file reader.
|
protected boolean |
reset
Whether the current file has already been reset.
|
protected ResultSet |
rs
The result set for a query.
|
protected double |
score
The current read score.
|
protected static Pattern |
SPLIT_SPACE_PLUS |
Constructor and Description |
---|
TRECResultsMatching(Index _index)
Contructs an instance of the TRECResultsMatching given an index.
|
TRECResultsMatching(Index _index,
String _filename)
Contructs an instance of the TRECResultsMatching.
|
TRECResultsMatching(Index _index,
String _filename,
String defDSMs)
Contructs an instance of the TRECResultsMatching.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkValid() |
protected void |
finalize() |
CollectionStatistics |
getCollectionStatistics()
Returns collection statistics.
|
protected int |
getDocid(String docno) |
String |
getInfo()
Return a human readable description of this Matching class
|
protected void |
initDSMs(String defDSMs) |
protected void |
initialise(int max)
Initialises the current result set by allocating memory for max results.
|
ResultSet |
match(String _qid,
MatchingQueryTerms mqt)
Get a ResultSet for the given query terms.
|
protected boolean |
read(String _qid) |
protected void |
reopen() |
void |
setCollectionStatistics(CollectionStatistics _collStats)
Update the collection statistics being used by this matching instance
|
protected static final Pattern SPLIT_SPACE_PLUS
protected Index index
protected CollectionStatistics collStats
protected static final String DSMNS
protected List<DocumentScoreModifier> dsms
protected String filename
protected BufferedReader reader
protected final TRECResultsMatching.InputFormat format
protected final boolean parseScores
protected final int maxResults
protected String qid
protected ResultSet rs
protected int docid
protected double score
protected boolean found
protected boolean reset
protected org.apache.log4j.Logger logger
public TRECResultsMatching(Index _index) throws IOException
_index
- IOException
public TRECResultsMatching(Index _index, String _filename) throws IOException
_index
- _filename
- IOException
public TRECResultsMatching(Index _index, String _filename, String defDSMs) throws IOException
_index
- _filename
- defDSMs
- IOException
protected void reopen() throws IOException
IOException
protected void initDSMs(String defDSMs)
public String getInfo()
Matching
protected int getDocid(String docno) throws IOException
IOException
protected boolean read(String _qid) throws IOException
IOException
protected boolean checkValid()
public ResultSet match(String _qid, MatchingQueryTerms mqt) throws IOException
Matching
match
in interface Matching
_qid
- - some ID of the querymqt
- - query terms to matchIOException
- if a problem occurs during matchingpublic void setCollectionStatistics(CollectionStatistics _collStats)
Matching
setCollectionStatistics
in interface Matching
_collStats
- CollectionStatistics to use during matchingpublic CollectionStatistics getCollectionStatistics()
protected void initialise(int max)
max
- The maximum number of results to be stored.Terrier 4.0. Copyright © 2004-2014 University of Glasgow