|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.matching.TRECResultsMatching
public class TRECResultsMatching
A matching implementation that retrieves results from a TREC result file rather than the current index. Such a result file must be compatible with trec_eval, i.e., it should have the following format:
queryID Q0 docno score rank label
Properties:
TRECQuerying.TRECDocidOutputFormat
.
Nested Class Summary | |
---|---|
static class |
TRECResultsMatching.InputFormat
input format |
Field Summary | |
---|---|
protected CollectionStatistics |
collStats
The underlying collections statistics. |
protected int |
docid
The current read document identifier. |
protected static java.lang.String |
DSMNS
The default namespace for document score modifiers. |
protected java.util.List<DocumentScoreModifier> |
dsms
The list of document score modifiers to be applied. |
protected java.lang.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 java.io.BufferedReader |
reader
The TREC results file reader. |
protected boolean |
reset
Whether the current file has already been reset. |
protected double |
score
The current read score. |
protected static java.util.regex.Pattern |
SPLIT_SPACE_PLUS
|
Constructor Summary | |
---|---|
TRECResultsMatching(Index _index)
Contructs an instance of the TRECResultsMatching given an index. |
|
TRECResultsMatching(Index _index,
java.lang.String _filename)
Contructs an instance of the TRECResultsMatching. |
|
TRECResultsMatching(Index _index,
java.lang.String _filename,
java.lang.String defDSMs)
Contructs an instance of the TRECResultsMatching. |
Method Summary | |
---|---|
protected void |
finalize()
|
CollectionStatistics |
getCollectionStatistics()
Returns collection statistics. |
protected int |
getDocid(java.lang.String docno)
|
java.lang.String |
getInfo()
Return a human readable description of this Matching class |
protected void |
initDSMs(java.lang.String defDSMs)
|
ResultSet |
match(java.lang.String _qid,
MatchingQueryTerms mqt)
Get a ResultSet for the given query terms. |
protected boolean |
read(java.lang.String _qid)
|
protected void |
reopen()
|
void |
setCollectionStatistics(CollectionStatistics _collStats)
Update the collection statistics being used by this matching instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.regex.Pattern SPLIT_SPACE_PLUS
protected Index index
protected CollectionStatistics collStats
protected static final java.lang.String DSMNS
protected java.util.List<DocumentScoreModifier> dsms
protected java.lang.String filename
protected java.io.BufferedReader reader
protected final TRECResultsMatching.InputFormat format
protected final boolean parseScores
protected final int maxResults
protected int docid
protected double score
protected boolean found
protected boolean reset
protected org.apache.log4j.Logger logger
Constructor Detail |
---|
public TRECResultsMatching(Index _index) throws java.io.IOException
_index
-
java.io.IOException
public TRECResultsMatching(Index _index, java.lang.String _filename) throws java.io.IOException
_index
- _filename
-
java.io.IOException
public TRECResultsMatching(Index _index, java.lang.String _filename, java.lang.String defDSMs) throws java.io.IOException
_index
- _filename
- defDSMs
-
java.io.IOException
Method Detail |
---|
protected void reopen() throws java.io.IOException
java.io.IOException
protected void initDSMs(java.lang.String defDSMs)
public java.lang.String getInfo()
Matching
getInfo
in interface Matching
protected int getDocid(java.lang.String docno) throws java.io.IOException
java.io.IOException
protected boolean read(java.lang.String _qid) throws java.io.IOException
java.io.IOException
public ResultSet match(java.lang.String _qid, MatchingQueryTerms mqt) throws java.io.IOException
Matching
match
in interface Matching
_qid
- - some ID of the querymqt
- - query terms to match
java.io.IOException
- 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 finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |