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/5/9 00013 // 00014 #ifndef _BOOLEANCLAUSE_H 00015 #define _BOOLEANCLAUSE_H 00016 00017 00018 namespace firtex 00019 { 00020 namespace search 00021 { 00022 class CQuery; 00023 class CBooleanClause 00024 { 00025 public: 00026 CBooleanClause(void):m_pQuery(0),m_bRequired(true),m_bProhibited(false) 00027 { 00028 } 00029 CBooleanClause(CQuery* pQuery,bool req,bool pro):m_bRequired(req),m_bProhibited(pro) 00030 { 00031 m_pQuery = pQuery->clone(); 00032 } 00033 CBooleanClause(const CBooleanClause& clone) 00034 { 00035 if(clone.m_pQuery) 00036 m_pQuery = clone.m_pQuery->clone(); 00037 else m_pQuery = NULL; 00038 m_bRequired = clone.m_bRequired; 00039 m_bProhibited = clone.m_bProhibited; 00040 } 00041 ~CBooleanClause(void) 00042 { 00043 if(m_pQuery) 00044 { 00045 delete m_pQuery; 00046 m_pQuery = NULL; 00047 } 00048 } 00049 public: 00050 CBooleanClause* clone(){return new CBooleanClause(*this);} 00051 00052 CQuery* getQuery(){return m_pQuery;} 00053 bool isRequired(){return m_bRequired;} 00054 bool isProhibited(){return m_bProhibited;} 00055 void setRequired(bool rq=true){m_bRequired = rq;} 00056 void setProhibited(bool p=true){m_bProhibited = p;} 00057 protected: 00058 CQuery* m_pQuery; 00059 bool m_bRequired; //必须出现 00060 bool m_bProhibited; //不能出现 00061 }; 00062 } 00063 } 00064 00065 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex