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.cs.cmu.edu/~lemur/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00012 #ifndef _INVFPTERMLIST_HPP 00013 #define _INVFPTERMLIST_HPP 00014 00015 #include "common_headers.hpp" 00016 #include "InvFPTerm.hpp" 00017 #include "InvFPTypes.hpp" 00018 00019 00027 class InvFPTermList : public TermInfoList { 00028 public: 00029 InvFPTermList(); 00030 ~InvFPTermList(); 00031 00033 void startIteration(); 00034 00036 bool hasMore(); 00037 00039 TermInfo *nextEntry(); 00040 00042 int docLength(){ return length; } 00043 00045 int termCount() { return listlen; } 00046 00048 int docID() { return uid; } 00049 00052 bool binRead(ifstream& infile); 00053 00055 void countTerms(); 00056 00057 private: 00058 00059 DOCID_T uid; // this doc's id 00060 int length; // length of this document (terms + stopwords) 00061 LocatedTerm* list; // list of terms and locations 00062 int listlen; // number of items we have in list (same as number of terms) 00063 int index; // index for iterator 00064 int* counts; // keep track of counts of terms for bag of words 00065 }; 00066 00067 00068 00069 00070 #endif