Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound 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"
00021 class InQueryRep : public StructQueryRep {
00022 public:
00023   InQueryRep(const TermQuery &qry, const Index &dbIndex, double db):
00024     StructQueryRep(qry, dbIndex, db) {}
00025   virtual ~InQueryRep() {}
00026 };
00027 
00033 
00034 class InQueryRetMethod : public StructQueryRetMethod {
00035 public:
00036 
00037   //  InQueryRetMethod(Index &dbIndex, ScoreAccumulator &accumulator);
00038   InQueryRetMethod(const Index &dbIndex, double belief, int fbTerms, 
00039                    double fbCoef, bool cacheIDF);
00040   virtual ~InQueryRetMethod() {
00041     delete[](idfV); 
00042     delete(scFunc);
00043   }
00044 
00045   virtual StructQueryRep *computeStructQueryRep(const TermQuery &qry) {
00046     return (new InQueryRep(qry, ind, defaultBelief));
00047   }
00048 
00049   virtual DocumentRep *computeDocRep(DOCID_T docID) { 
00050     return (new StructQryDocRep(docID, idfV, ind.docLength(docID),
00051                                 docCount, docLengthAverage, 
00052                                 defaultBelief));
00053   }
00054   virtual ScoreFunction *scoreFunc() {
00055     return (scFunc);
00056   }
00059   virtual void updateStructQuery(StructQueryRep &qryRep, const DocIDSet &relDocs);
00060 private:
00061   double *idfV;
00062   ScoreFunction *scFunc; 
00063   double fbCoeff;
00064   int fbTermCount;
00065   double defaultBelief;
00066   int docCount;
00067   double docLengthAverage;
00068 };
00069 #endif /* _INQUERYRETMETHOD_HPP */
00070 
00071 
00072 
00073 
00074 
00075 
00076 

Generated on Wed Nov 3 12:58:58 2004 for Lemur Toolkit by doxygen1.2.18