00001 /*========================================================================== 00002 * Copyright (c) 2006 Carnegie Mellon University. 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 below), and also available at 00007 * http://www.lemurproject.org/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00012 // 00013 // ExtentParentNode 00014 // 00015 // 31 Jan 2006 - pto 00016 // 00017 // 00018 // Checks to make sure the inner node has an extent that matches the extent 00019 // of a parent of nodes whose extents matching the outer extent 00020 // 00021 00022 #ifndef INDRI_EXTENTPARENTNODE_HPP 00023 #define INDRI_EXTENTPARENTNODE_HPP 00024 00025 #include "indri/ListIteratorNode.hpp" 00026 #include "indri/DocumentStructureHolderNode.hpp" 00027 #include "indri/greedy_vector" 00028 #include "indri/Extent.hpp" 00029 namespace indri 00030 { 00031 namespace infnet 00032 { 00033 00034 class ExtentParentNode : public ListIteratorNode { 00035 ListIteratorNode* _inner; 00036 ListIteratorNode* _outer; 00037 DocumentStructureHolderNode & _docStructHolder; 00038 indri::utility::greedy_vector<indri::index::Extent> _extents; 00039 std::string _name; 00040 00041 00042 std::set<int> _ancestors; 00043 std::set<int> _leafs; 00044 00045 00046 public: 00047 ExtentParentNode( const std::string& name, 00048 ListIteratorNode* inner, 00049 ListIteratorNode* outer, 00050 DocumentStructureHolderNode & documentStructureHolderNode ); 00051 00052 void prepare( lemur::api::DOCID_T documentID ); 00053 const indri::utility::greedy_vector<indri::index::Extent>& extents(); 00054 lemur::api::DOCID_T nextCandidateDocument(); 00055 void indexChanged( indri::index::Index& index ); 00056 00057 const std::string& getName() const; 00058 void annotate( class Annotator& annotator, lemur::api::DOCID_T documentID, indri::index::Extent &extent ); 00059 00060 const indri::utility::greedy_vector<indri::index::Extent>& matches( indri::index::Extent &extent ); 00061 }; 00062 } 00063 } 00064 00065 #endif // INDRI_EXTENTPARENTNODE_HPP 00066