00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef INDRI_LISTBELIEFNODE_HPP
00020 #define INDRI_LISTBELIEFNODE_HPP
00021
00022 #include "indri/BeliefNode.hpp"
00023 #include "indri/TermScoreFunction.hpp"
00024 #include "indri/greedy_vector"
00025 #include "indri/ListIteratorNode.hpp"
00026 #include "indri/ScoredExtentResult.hpp"
00027
00028 class ListBeliefNode : public BeliefNode {
00029 private:
00030 ListIteratorNode& _list;
00031 ListIteratorNode* _context;
00032 ListIteratorNode* _raw;
00033 double _maximumScore;
00034 double _maximumBackgroundScore;
00035 TermScoreFunction& _scoreFunction;
00036 greedy_vector<ScoredExtentResult> _scores;
00037 std::string _name;
00038 bool _documentSmoothing;
00039
00040 private:
00041
00042 inline int _contextLength( int begin, int end );
00043 inline int _contextOccurrences( int begin, int end );
00044 inline int _documentOccurrences();
00045
00046 public:
00047 ListBeliefNode( const std::string& name,
00048 ListIteratorNode& child,
00049 ListIteratorNode* context,
00050 ListIteratorNode* raw,
00051 TermScoreFunction& scoreFunction,
00052 double maximumBackgroundScore,
00053 double maximumScore );
00054
00055 int nextCandidateDocument();
00056 double maximumBackgroundScore();
00057 double maximumScore();
00058 const greedy_vector<ScoredExtentResult>& score( int documentID, int begin, int end, int documentLength );
00059 void annotate( class Annotator& annotator, int documentID, int begin, int end );
00060 bool hasMatch( int documentID );
00061 const std::string& getName() const;
00062 };
00063
00064 #endif // INDRI_TERMNODE_HPP