Main Page   Namespace List   Class Hierarchy   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.cs.cmu.edu/~lemur/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 
00022 namespace InQueryParameter {
00023   struct docParam {
00025     double defaultBelief;
00026   };
00027   struct qryParam {
00029     double fbCoeff;
00031     int fbTermCount;
00032   };
00033 
00034   static double defaultFBCoeff = 0.5;
00035   static int defaultFBTermCount = 50;
00036   static double defaultBelief = 0.4;
00037 };
00038 
00040 class InQueryRep : public StructQueryRep {
00041 public:
00043   InQueryRep(StructQuery &qry, InvFPIndex &dbIndex) :  StructQueryRep(qry, dbIndex, InQueryParameter::defaultBelief), ind(dbIndex) {}
00044   virtual ~InQueryRep() {}
00045 
00046 protected:
00047   double *idf;
00048   InvFPIndex &ind;
00049 };
00050 
00051 
00057 
00058 class InQueryRetMethod : public StructQueryRetMethod {
00059 public:
00060 
00061   InQueryRetMethod(InvFPIndex &dbIndex, ScoreAccumulator &accumulator);
00062   virtual ~InQueryRetMethod() {delete [] idfV; delete scFunc;}
00063 
00064   virtual StructQueryRep *computeStructQueryRep(StructQuery &qry) {
00065     return (new InQueryRep(qry, index));
00066   }
00067 
00068   virtual DocumentRep *computeDocRep(int docID) { 
00069     return (new StructQryDocRep(docID, index, idfV));
00070   }
00071   virtual ScoreFunction *scoreFunc() {
00072     return (scFunc);
00073   }
00077   virtual void updateStructQuery(StructQueryRep &qryRep, DocIDSet &relDocs);
00078 
00079   void setDocINQParam(InQueryParameter::docParam &dParam);
00080   void setQueryINQParam(InQueryParameter::qryParam &qParam);
00081 
00082 protected:
00083   double *idfV;
00085   ScoreFunction *scFunc; 
00086   InQueryParameter::qryParam qryPrm;
00087   InQueryParameter::docParam docPrm;
00088 
00089 };
00090 
00091 inline void InQueryRetMethod::setDocINQParam(InQueryParameter::docParam &dParam)
00092 {
00093   docPrm = dParam;
00094 }
00095 
00096 
00097 
00098 inline void InQueryRetMethod::setQueryINQParam(InQueryParameter::qryParam &qParam)
00099 {
00100   qryPrm = qParam;
00101 }
00102 
00103 #endif /* _INQUERYRETMETHOD_HPP */
00104 
00105 
00106 
00107 
00108 
00109 
00110 

Generated on Mon Sep 30 14:13:21 2002 for LEMUR by doxygen1.2.18