00001 /*========================================================================== 00002 * Copyright (c) 2001 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 _TEXTQUERY_HPP 00013 #define _TEXTQUERY_HPP 00014 00015 #include "Document.hpp" 00016 #include "TermQuery.hpp" 00017 00018 namespace lemur 00019 { 00020 namespace api 00021 { 00022 00026 class TextQuery : public TermQuery { 00027 public: 00028 TextQuery(const Document &doc) : d(doc) { 00029 if (d.getID()) qid=d.getID(); 00030 else qid=""; } 00031 virtual ~TextQuery() {} 00032 00033 virtual void startTermIteration() const { d.startTermIteration();} 00034 virtual bool hasMore() const { return d.hasMore();} 00035 virtual const Term *nextTerm() const { return d.nextTerm();} 00036 protected: 00037 const Document &d; 00038 }; 00039 } 00040 } 00041 00042 #endif