Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TextQueryRetMethod.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.cs.cmu.edu/~lemur/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 #ifndef _TEXTQUERYRETMETHOD_HPP
00014 #define _TEXTQUERYRETMETHOD_HPP
00015 
00016 
00017 #include "RetrievalMethod.hpp"
00018 #include "TextQueryRep.hpp"
00019 #include "DocumentRep.hpp"
00020 #include "ScoreFunction.hpp"
00021 #include "ScoreAccumulator.hpp"
00022 #include "FreqVector.hpp"
00023 
00024 //----------------------------------------------------------------------
00025 //      Abstract Interface for A Retrieval Method/Model for Text Query
00026 //----------------------------------------------------------------------
00027 
00075 class TextQueryRetMethod : public RetrievalMethod {
00076 public:
00077   TextQueryRetMethod(Index &ind, ScoreAccumulator & accumulator) : 
00078     RetrievalMethod(ind), scAcc(accumulator) {}
00079   virtual ~TextQueryRetMethod() {}
00081   virtual TextQueryRep *computeTextQueryRep(TextQuery &qry)=0;
00082 
00084   virtual QueryRep *computeQueryRep(Query &qry); 
00085 
00087   virtual double scoreDoc(QueryRep &qry, int docID);
00089   virtual void scoreCollection(QueryRep &qry, IndexedRealVector &results);
00090 
00092   virtual DocumentRep *computeDocRep(int docID) =0;
00094   virtual ScoreFunction *scoreFunc() = 0;
00096   virtual void updateQuery(QueryRep &qryRep, DocIDSet &relDocs) {
00097     updateTextQuery(*((TextQueryRep *)(&qryRep)), relDocs);
00098   }
00099 
00101   virtual void updateTextQuery(TextQueryRep &qryRep, DocIDSet &relDocs)=0;
00102 
00104 
00107   virtual void scoreInvertedIndex(QueryRep &qryRep, IndexedRealVector &scores, bool scoreAll=false);
00108 
00109   virtual double scoreDocVector(TextQueryRep &qry, int docID, FreqVector &docVector);
00110 
00111 protected:
00112   ScoreAccumulator &scAcc;
00113 };
00114 
00115 
00116 //=============== inlines ========================================
00117 
00118 inline QueryRep *TextQueryRetMethod::computeQueryRep(Query &qry) { 
00119   TextQuery *q = static_cast<TextQuery *>(&qry);
00120   return (computeTextQueryRep(*q));
00121 }
00122 
00123 #endif /* _TEXTQUERYRETMETHOD_HPP */
00124 
00125 
00126 
00127 

Generated at Fri Jul 26 18:22:27 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000