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 /* 00013 author: fff 00014 */ 00015 #ifndef _RELDOCUNIGRAMCOUNTER_HPP 00016 #define _RELDOCUNIGRAMCOUNTER_HPP 00017 00018 #include "common_headers.hpp" 00019 #include "WeightedIDSet.hpp" 00020 #include "Counter.hpp" 00021 #include "Index.hpp" 00022 #include <cmath> 00023 00026 00027 class RelDocUnigramCounter : public ArrayCounter <double> { 00028 public: 00030 RelDocUnigramCounter(DOCID_T docID, const Index &homeIndex); 00031 00033 RelDocUnigramCounter(const WeightedIDSet &docSet, const Index &homeIndex); 00034 00035 virtual ~RelDocUnigramCounter() {} 00036 const string lexiconID() const { return (ind.termLexiconID());} 00037 00038 protected: 00041 void countRelDocUnigram(DOCID_T docID, double weight=1); 00042 00043 const Index &ind; 00044 }; 00045 00046 00047 #endif /* _RELDOCUNIGRAMCOUNTER_HPP */