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 // FieldWildcardNode 00015 // 00016 // 18 June 2005 -- pto 00017 // 00018 // This node poplulates the field list with all fields in the document contained 00019 // within the "outer" field as candidate fields. Slow as it requires 00020 // scanning the field list for the doc or scanning a document structure object. 00021 // 00022 00023 #ifndef INDRI_FIELDWILDCARDNODE_HPP 00024 #define INDRI_FIELDWILDCARDNODE_HPP 00025 00026 #include "indri/ListIteratorNode.hpp" 00027 #include "indri/greedy_vector" 00028 #include "indri/Index.hpp" 00029 00030 namespace indri { 00031 namespace infnet { 00032 00033 class FieldWildcardNode : public ListIteratorNode { 00034 indri::utility::greedy_vector<indri::index::Extent> _extents; 00035 std::string _name; 00036 indri::index::Index * _index; 00037 lemur::api::DOCID_T _nextDocument; 00038 indri::index::TermListFileIterator * _docIter; 00039 int _docIterID; 00040 00041 public: 00042 FieldWildcardNode( const std::string& name ); 00043 ~FieldWildcardNode( ); 00044 00045 void prepare( lemur::api::DOCID_T documentID ); 00046 const indri::utility::greedy_vector<indri::index::Extent>& extents(); 00047 lemur::api::DOCID_T nextCandidateDocument(); 00048 const std::string& getName() const; 00049 void annotate( class Annotator& annotator, lemur::api::DOCID_T documentID, indri::index::Extent &extent ); 00050 00051 void indexChanged( indri::index::Index& index); 00052 }; 00053 } 00054 } 00055 #endif // INDRI_FIELDWILDCARDNODE_HPP 00056