00001 /*========================================================================== 00002 * Copyright (c) 2002 Carnegie Mellon University. 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 #include <iomanip> 00013 #include "Passage.hpp" 00014 #include <vector> 00015 00016 using std::vector; 00017 00018 #ifndef _MMRPASSAGE_HPP 00019 #define _MMRPASSAGE_HPP 00020 00026 class MMRPassage : public Passage { 00027 00028 public: 00029 double wt; 00030 double wtSim; 00031 double qSim; 00032 double maxSim; 00033 00034 MMRPassage(const string &id) { 00035 psg = new passageVec; 00036 docID = id; 00037 score = -1; 00038 marked = 0; 00039 wt = 1.0; 00040 qSim = 0.0; 00041 wtSim = 0.0; 00042 maxSim = -1.0; 00043 } 00044 00045 virtual void clear(); 00046 00047 virtual void addTerm(termCount term); 00048 00049 virtual void addTerms(const passageVec pv); 00050 00051 virtual const passageVec* getAsVector(void) const; 00052 00053 virtual int operator<(const Passage &b) const; 00054 00055 virtual double computeMMR(double lambda) const; 00056 00057 virtual double dotProduct(MMRPassage b) const; 00058 00059 virtual void scale(double val) const; 00060 00061 }; 00062 00063 #endif