|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.matching.OldBasicMatching
public class OldBasicMatching
This is the original matching implementation of Terrier. Performs the matching of documents with a query, by first assigning scores to documents for each query term and modifying these scores with the appropriate modifiers. Then, a series of document score modifiers are applied if necessary.
Field Summary | |
---|---|
protected CollectionStatistics |
collectionStatistics
The collection statistics |
protected java.util.ArrayList<DocumentScoreModifier> |
documentModifiers
Contains the document score modifiers to be applied for a query. |
protected static java.lang.String |
dsmNamespace
The default namespace for the document score modifiers that are specified in the properties file. |
protected static boolean |
IGNORE_LOW_IDF_TERMS
A property that enables to ignore the terms with a low IDF. |
protected Index |
index
The index used for retrieval. |
protected PostingIndex<BitIndexPointer> |
invertedIndex
The inverted file. |
protected Lexicon<java.lang.String> |
lexicon
The lexicon used. |
protected static org.apache.log4j.Logger |
logger
the logger for this class |
protected static boolean |
MATCH_EMPTY_QUERY
A property that when it is true, it allows matching all documents to an empty query. |
protected int |
numberOfRetrievedDocuments
The number of retrieved documents for a query. |
protected ResultSet |
resultSet
The result set. |
protected static int |
RETRIEVED_SET_SIZE
The maximum number of documents in the final retrieved set. |
Constructor Summary | |
---|---|
protected |
OldBasicMatching()
|
|
OldBasicMatching(Index _index)
A default constructor that creates the CollectionResultSet and initialises the document and term modifier containers. |
Method Summary | |
---|---|
void |
addDocumentScoreModifier(DocumentScoreModifier documentScoreModifier)
Registers a document score modifier. |
protected void |
assignScores(int i,
WeightingModel[] wModels,
ResultSet rs,
IterablePosting postings,
LexiconEntry lEntry,
double queryTermWeight)
Assign scores method |
DocumentScoreModifier |
getDocumentScoreModifier(int i)
Returns the i-th registered document score modifier. |
java.lang.String |
getInfo()
Returns a descriptive string for the retrieval process performed. |
ResultSet |
getResultSet()
Deprecated. match() now returns the ResultSet |
protected void |
initialise()
Initialises the arrays prior of retrieval. |
protected void |
initialise(double[] scs)
Initialises the arrays prior of retrieval, with the given scores. |
protected void |
initialiseDSMs()
|
ResultSet |
match(java.lang.String queryNumber,
MatchingQueryTerms queryTerms)
Implements the matching of a query with the documents. |
void |
setCollectionStatistics(CollectionStatistics cs)
Set the collection statistics. |
void |
setModel(Model model)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger logger
protected static final java.lang.String dsmNamespace
protected static int RETRIEVED_SET_SIZE
protected static boolean IGNORE_LOW_IDF_TERMS
protected static boolean MATCH_EMPTY_QUERY
protected int numberOfRetrievedDocuments
protected Index index
protected Lexicon<java.lang.String> lexicon
protected PostingIndex<BitIndexPointer> invertedIndex
protected CollectionStatistics collectionStatistics
protected ResultSet resultSet
protected java.util.ArrayList<DocumentScoreModifier> documentModifiers
Constructor Detail |
---|
protected OldBasicMatching()
public OldBasicMatching(Index _index)
_index
- the object that encapsulates the basic
data structures used for retrieval.Method Detail |
---|
protected void initialiseDSMs()
public ResultSet getResultSet()
protected void initialise()
protected void initialise(double[] scs)
scs
- double[] the scores to initialise the result set with.public void addDocumentScoreModifier(DocumentScoreModifier documentScoreModifier)
documentScoreModifier
- DocumentScoreModifier the score modifier to be
applied.public DocumentScoreModifier getDocumentScoreModifier(int i)
public void setModel(Model model)
model
- the weighting model used for retrievalpublic void setCollectionStatistics(CollectionStatistics cs)
setCollectionStatistics
in interface Matching
cs
- CollectionStatistics to use during matchingpublic java.lang.String getInfo()
getInfo
in interface Matching
public ResultSet match(java.lang.String queryNumber, MatchingQueryTerms queryTerms) throws java.io.IOException
match
in interface Matching
queryNumber
- the identifier of the processed query.queryTerms
- the query terms to be processed.
java.io.IOException
- if a problem occurs during matchingprotected void assignScores(int i, WeightingModel[] wModels, ResultSet rs, IterablePosting postings, LexiconEntry lEntry, double queryTermWeight) throws java.io.IOException
i
- which query term is thiswModels
- weighting models to use for this termrs
- Resultset to alterpostings
- post list to processlEntry
- entry statisticsqueryTermWeight
- weight of the query term
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |