FirteX-高性能全文索引和检索平台API Documentation |
00001 // 00002 // Copyright(C) 2005--2006 Institute of Computing Tech, Chinese Academy of Sciences. 00003 // All rights reserved. 00004 // This file is part of FirteX (www.firtex.org) 00005 // 00006 // Use of the FirteX is subject to the terms of the software license set forth in 00007 // the LICENSE file included with this software, and also available at 00008 // http://www.firtex.org/license.html 00009 // 00010 // Author : 郭瑞杰(GuoRuijie) 00011 // Email : ruijieguo@software.ict.ac.cn,ruijieguo@gmail.com 00012 // Created : 2006/3/9 00013 // 00014 #ifndef _WEIGHT_H 00015 #define _WEIGHT_H 00016 #include "../utility//StdHeader.h" 00017 #include "Query.h" 00018 00019 namespace firtex 00020 { 00021 namespace search 00022 { 00023 class CWeight 00024 { 00025 public: 00026 CWeight(void) 00027 :m_pQuery(NULL) 00028 ,m_bDeleteQuery(false) 00029 { 00030 } 00031 CWeight(CQuery* pQuery,bool bDeleteQuery) 00032 :m_pQuery(pQuery) 00033 ,m_bDeleteQuery(bDeleteQuery) 00034 { 00035 } 00036 virtual ~CWeight(void) 00037 { 00038 if(m_pQuery && m_bDeleteQuery) 00039 delete m_pQuery; 00040 m_pQuery = NULL; 00041 } 00042 public: 00043 virtual weight_t squaredWeight() = 0; 00044 virtual void normalize(float fQueryNorm)=0; 00045 virtual weight_t getValue()=0; 00046 00047 CQuery* getQuery(){return m_pQuery;} 00048 00049 void setQuery(CQuery* pQuery,bool bDeleteQuery){m_pQuery = pQuery;m_bDeleteQuery = bDeleteQuery;} 00050 void setDeleteQuery(bool bDeleteQuery = true){m_bDeleteQuery = bDeleteQuery;} 00051 private: 00052 CQuery* m_pQuery; 00053 bool m_bDeleteQuery; 00054 }; 00055 } 00056 } 00057 00058 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex