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

ListBeliefNode.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 //
00014 // ListBeliefNode
00015 //
00016 // 26 January 2004 - tds
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   // computes the length of the scored context
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

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