00001 /*========================================================================== 00002 * Copyright (c) 2002 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 also available at 00007 * http://www.lemurproject.org/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00012 #ifndef _INDRIDOCUMENTMANAGER_HPP 00013 #define _INDRIDOCUMENTMANAGER_HPP 00014 00015 #include "IndexTypes.hpp" 00016 #include "DocumentManager.hpp" 00017 #include "indri/Repository.hpp" 00018 #include "Match.hpp" 00019 namespace lemur 00020 { 00021 namespace parse 00022 { 00023 00032 class IndriDocMgr : public lemur::api::DocumentManager { 00033 public: 00034 IndriDocMgr(indri::collection::Repository &repository, string name="IndriDocMgr") : 00035 _repository(repository), _name(name) {} 00036 virtual ~IndriDocMgr() {} 00039 virtual bool open(const string &manname) { 00040 return true; 00041 } 00042 00044 virtual char* getDoc(const lemur::api::EXDOCID_T &docID) const; 00045 00049 vector<Match> getOffsets(const lemur::api::EXDOCID_T &docID) const; 00050 00051 00053 virtual lemur::api::Parser* getParser() const {return NULL;} 00054 00056 virtual void buildMgr() {} 00057 00059 virtual const string &getMyID() const {return _name; } 00060 00061 private: 00062 indri::index::Index* _indexWithDocument( indri::collection::Repository::index_state& indexes, lemur::api::DOCID_T documentID ) const ; 00063 00064 indri::collection::Repository &_repository; 00065 string _name; 00066 }; 00067 } 00068 } 00069 00070 #endif 00071 // _INDRIDOCUMENTMANAGER_HPP