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

InQueryRetMethod.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2002 University of Massachusetts.  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.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010  */
00011 /*
00012   Author: fff
00013 */
00014 
00015 #ifndef _INQUERYRETMETHOD_HPP
00016 #define _INQUERYRETMETHOD_HPP
00017 
00018 #include "StructQueryRetMethod.hpp"
00019 #include "StructQryDocRep.hpp"
00020 namespace lemur 
00021 {
00022   namespace retrieval 
00023   {
00024     
00026     class InQueryRep : public StructQueryRep {
00027     public:
00028       InQueryRep(const lemur::api::TermQuery &qry, const lemur::api::Index &dbIndex, double db):
00029         StructQueryRep(qry, dbIndex, db) {}
00030       virtual ~InQueryRep() {}
00031     };
00032 
00034 
00035 
00036 
00037 
00038 
00039 
00040     class InQueryRetMethod : public lemur::api::StructQueryRetMethod {
00041     public:
00042 
00043       //  InQueryRetMethod(Index &dbIndex, ScoreAccumulator &accumulator);
00044       InQueryRetMethod(const lemur::api::Index &dbIndex, double belief, int fbTerms, 
00045                        double fbCoef, bool cacheIDF);
00046       virtual ~InQueryRetMethod() {
00047         delete[](idfV); 
00048         delete(scFunc);
00049       }
00050 
00051       virtual StructQueryRep *computeStructQueryRep(const lemur::api::TermQuery &qry) {
00052         return (new InQueryRep(qry, ind, defaultBelief));
00053       }
00054 
00055       virtual lemur::api::DocumentRep *computeDocRep(lemur::api::DOCID_T docID) { 
00056         return (new StructQryDocRep(docID, idfV, ind.docLength(docID),
00057                                     docCount, docLengthAverage, 
00058                                     defaultBelief));
00059       }
00060       virtual lemur::api::ScoreFunction *scoreFunc() {
00061         return (scFunc);
00062       }
00065       virtual void updateStructQuery(StructQueryRep &qryRep, const lemur::api::DocIDSet &relDocs);
00066     private:
00067       double *idfV;
00068       lemur::api::ScoreFunction *scFunc; 
00069       double fbCoeff;
00070       int fbTermCount;
00071       double defaultBelief;
00072       int docCount;
00073       double docLengthAverage;
00074     };
00075   }
00076 }
00077 
00078 #endif /* _INQUERYRETMETHOD_HPP */

Generated on Tue Jun 15 11:02:54 2010 for Lemur by doxygen 1.3.4