Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

WeightedSumNode.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2004 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 // WeightedSumNode
00014 //
00015 // 31 March 2004 -- tds
00016 //
00017 // Implements the InQuery #wsum operator.
00018 //
00019 // Note that this class transforms the probabilities
00020 // out of log space and back into log space, which
00021 // could cause a loss of precision.
00022 //
00023 
00024 #ifndef INDRI_WEIGHTEDSUMNODE_HPP
00025 #define INDRI_WEIGHTEDSUMNODE_HPP
00026 
00027 #include "indri/BeliefNode.hpp"
00028 #include <vector>
00029 #include "indri/greedy_vector"
00030 #include "indri/ScoredExtentResult.hpp"
00031 
00032 class WeightedSumNode : public BeliefNode {
00033 private:
00034   std::vector<BeliefNode*> _children;
00035   std::vector<double> _weights;
00036   greedy_vector<ScoredExtentResult> _scores;
00037   std::string _name;
00038 
00039 public:
00040   WeightedSumNode( const std::string& name );
00041 
00042   int nextCandidateDocument();
00043   double maximumScore();
00044   double maximumBackgroundScore();
00045 
00046   const greedy_vector<ScoredExtentResult>& score( int documentID, int begin, int end, int documentLength );
00047   void annotate( class Annotator& annotator, int documentID, int begin, int end );
00048   bool hasMatch( int documentID );
00049   void addChild( double weight, BeliefNode* child );
00050   const std::string& getName() const;
00051 };
00052 
00053 #endif // INDRI_WEIGHTEDSUMNODE_HPP

Generated on Wed Nov 3 12:59:07 2004 for Lemur Toolkit by doxygen1.2.18