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 // ExtentRestrictionNode 00015 // 00016 // 6 July 2004 -- tds 00017 // 00018 00019 #ifndef INDRI_EXTENTRESTRICTIONNODE_HPP 00020 #define INDRI_EXTENTRESTRICTIONNODE_HPP 00021 00022 #include "indri/BeliefNode.hpp" 00023 #include "indri/FieldIteratorNode.hpp" 00024 #include "indri/greedy_vector" 00025 #include "indri/Extent.hpp" 00026 00027 class ExtentRestrictionNode : public BeliefNode { 00028 private: 00029 BeliefNode* _child; 00030 ListIteratorNode* _field; 00031 greedy_vector<ScoredExtentResult> _scores; 00032 std::string _name; 00033 00034 public: 00035 ExtentRestrictionNode( const std::string& name, BeliefNode* child, ListIteratorNode* field ); 00036 00037 int nextCandidateDocument(); 00038 double maximumScore(); 00039 double maximumBackgroundScore(); 00040 00041 const greedy_vector<ScoredExtentResult>& score( int documentID, int begin, int end, int documentLength ); 00042 void annotate( class Annotator& annotator, int documentID, int begin, int end ); 00043 bool hasMatch( int documentID ); 00044 const std::string& getName() const; 00045 }; 00046 00047 #endif // INDRI_EXTENTRESTRICTIONNODE_HPP