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 _ANALYZERPLUGINS_H 00015 #define _ANALYZERPLUGINS_H 00016 00017 #include "../analyzer/Analyzer.h" 00018 #include <map> 00019 #include <string> 00020 #include "FirteXCOM.h" 00021 00022 using namespace firtex::analyzer; 00023 using namespace std; 00024 00025 namespace firtex 00026 { 00027 namespace plugin 00028 { 00029 class CAnalyzerPlugin : public CAnalyzer 00030 { 00031 public: 00032 CAnalyzerPlugin(IAnalyzerPlugin* pAnalyzerInterface); 00033 CAnalyzerPlugin(IAnalyzerPlugin* pAnalyzerInterface,CParser* pParser); 00034 virtual ~CAnalyzerPlugin(); 00035 public: 00036 firtex::analyzer::TokenType getTokenType(); 00037 protected: 00038 CTokens* nextTokensInternal(CReader* reader,CTokens* pInput/* =NULL */); 00039 protected: 00040 00041 IAnalyzerPlugin* m_pAnalyzerInterface; 00042 ITokens* m_pTokensInterface; 00043 IReader* m_pReaderInterface; 00044 CReader* m_pOldReaders; 00045 CTokens* m_pOldTokens; 00046 bool m_bOwnTokens; 00047 }; 00048 00049 class CAnalyzerPlugins 00050 { 00051 public: 00052 CAnalyzerPlugins(void); 00053 ~CAnalyzerPlugins(void); 00054 public: 00055 CAnalyzer* getAnalyzer(const tchar* analyzerName); 00056 CAnalyzer* getAnalyzer(firtex::analyzer::TokenType tokenType); 00057 protected: 00058 map<tstring,IAnalyzerPlugin*>m_pluginMap; 00059 }; 00060 } 00061 } 00062 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex