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

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

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