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

StructQueryRep.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 _STRUCTQUERYREP_HPP
00016 #define _STRUCTQUERYREP_HPP
00017 
00018 #include "RetrievalMethod.hpp"
00019 #include "TextQuery.hpp"
00020 #include "Index.hpp"
00021 #include "QueryNode.hpp"
00022 
00023 namespace lemur 
00024 {
00025   namespace retrieval
00026   {
00027     
00029 
00035     class StructQueryRep : public lemur::api::QueryRep {
00036     public:
00038       StructQueryRep(const lemur::api::TermQuery &qry, const lemur::api::Index &dbIndex, 
00039                      double dbelief = 0);
00040 
00041       virtual ~StructQueryRep() {
00042         delete(topNode);
00043       }
00047       virtual QueryNode * topnode() const {return topNode;}
00049       virtual void setTopnode(QueryNode *qn) {topNode = qn;}
00050   
00051     private:
00053       typedef QueryNode *(StructQueryRep::*getFunc)(const lemur::api::TermQuery &, const lemur::api::Term *,
00054                                                     double);
00056       QnList * getChildren(const lemur::api::TermQuery &qry, getFunc fn, 
00057                            bool weigh = false);
00059       QueryNode * getQryNode(const lemur::api::TermQuery &qry, const lemur::api::Term *tok, double w);
00061       QueryNode * getProxQryNode(const lemur::api::TermQuery &qry, const lemur::api::Term *tok,
00062                                  double w = 1.0);
00064       QueryNode *topNode;
00066       QueryNode *qStack[100]; 
00067 
00068       int topqStack;
00070       double dw;
00072       const lemur::api::Index &ind;
00074       int numDocs;
00075     };
00076   }
00077 }
00078 
00079 #endif /* _STRUCTQUERYREP_HPP */
00080 

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