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 // DocumentStructureHolderNode 00015 // 00016 // 18 June 2005 -- pto 00017 // 00018 // This node stores the document structure for the current document 00019 // to be shared among shrinkage belief nodes or other nodes that 00020 // may need to use the document structure for retrieval. 00021 // 00022 00023 #ifndef INDRI_DOCUMENTSTRUCTUREHOLDERNODE_HPP 00024 #define INDRI_DOCUMENTSTRUCTUREHOLDERNODE_HPP 00025 00026 #include "indri/ListIteratorNode.hpp" 00027 #include "indri/greedy_vector" 00028 #include "indri/Index.hpp" 00029 #include "indri/DocumentStructure.hpp" 00030 00031 namespace indri { 00032 namespace infnet { 00033 00034 class DocumentStructureHolderNode : public InferenceNetworkNode { 00035 private: 00036 indri::index::Index * _index; 00037 lemur::api::DOCID_T _nextDocument; 00038 indri::index::TermListFileIterator * _docIter; 00039 lemur::api::DOCID_T _docIterID; 00040 std::string _name; 00041 indri::index::DocumentStructure * _documentStructure; 00042 00043 public: 00044 DocumentStructureHolderNode( const std::string& name ); 00045 ~DocumentStructureHolderNode(); 00046 00047 void prepare( lemur::api::DOCID_T documentID ); 00048 lemur::api::DOCID_T nextCandidateDocument(); 00049 const std::string& getName() const; 00050 indri::index::DocumentStructure * getDocumentStructure(); 00051 00052 void indexChanged( indri::index::Index& index); 00053 }; 00054 } 00055 } 00056 #endif // INDRI_DOCUMENTSTRUCTUREHOLDERNODE_HPP 00057