00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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