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 _DEFAULT_SIMILARITY_H 00015 #define _DEFAULT_SIMILARITY_H 00016 00017 #include "Similarity.h" 00018 00019 namespace firtex 00020 { 00021 namespace search 00022 { 00023 class CDefaultSimilarity : public CSimilarity 00024 { 00025 public: 00026 CDefaultSimilarity(void); 00027 virtual ~CDefaultSimilarity(void); 00028 public: 00029 00035 float tf(float freq); 00036 00043 float idf(freq_t docFreq, count_t numDocs); 00044 00045 float sloppyFreq(int distance); 00046 00047 float lengthNorm(count_t numTerms); 00048 00049 float queryNorm(float sumOfSquaredWeights); 00050 00051 float coord(int overlap, int maxOverlap); 00052 }; 00053 } 00054 } 00055 00056 00057 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex