Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ProxInfo.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2002-2003 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.cs.cmu.edu/~lemur/license.html
00008  *
00009  *==========================================================================
00010 */
00011 /*
00012   author: fff, dmf
00013   * split out into separate header. Rewrite to use DocInfoList w/o copy.
00014 */
00015 #ifndef _PROXINFO_HPP_
00016 #define _PROXINFO_HPP_
00017 
00018 #include "InvFPIndex.hpp"
00022 class ProxInfo {
00023 public: 
00025   ProxInfo() : nextPos(0), posList(NULL), size(0),
00026                dList(NULL), listSize(0) { }
00028   ProxInfo::ProxInfo(int num, int tf, DocInfoList *dl) : nextPos(0), 
00029                                                          posList(NULL),  
00030                                                          size(0),
00031                                                          dList(dl),  
00032                                                          listSize(tf) { }
00034   ProxInfo(int  num, int tf, int *pl);
00036   ~ProxInfo() { delete(dList); delete[](posList);}
00037 
00039   int id() {return currEntry.docID();}
00041   int count() {return currEntry.termCount();}
00043   int *positions() {return currEntry.positions();}
00046   int position(int k) {return *(positions() + k);}
00048   void startIteration() {
00049     if (dList != NULL) dList->startIteration();
00050   }
00052   bool hasMore() {return(dList != NULL && dList->hasMore());}
00054   bool nextDoc();
00057   bool nextDoc(int did);
00059   int posSize();  
00061   int size;
00064   int nextPos;
00065 private:
00067   int *posList; // internally allocated, must use delete[]()
00069   DocInfoList *dList;
00070   InvFPDocInfo currEntry;
00071   int listSize;
00072 };
00073 #endif

Generated on Tue Nov 25 11:26:45 2003 for Lemur Toolkit by doxygen1.2.18