Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

InvFPDocList.hpp

Go to the documentation of this file.
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 
00013 #ifndef _INVFPDOCLIST_HPP
00014 #define _INVFPDOCLIST_HPP
00015 
00016 /*
00017  * NAME DATE - COMMENTS
00018  * tnt 03/2001 - created
00019  * tnt 06/2002 - subclass from InvDocList
00020  *
00021  *========================================================================*/
00022 #include <cmath>
00023 #include "common_headers.hpp"
00024 #include "InvDocList.hpp"
00025 #include "InvFPDocInfo.hpp"
00026 #include "MemCache.hpp"
00027 
00028 extern "C" {
00029 #include <cstdio>
00030 }
00031 
00032 #define DEFAULT 9
00033 namespace lemur 
00034 {
00035   namespace index 
00036   {
00037     
00038     class InvFPDocList: public InvDocList {
00039     public:
00040       InvFPDocList();
00042       InvFPDocList(lemur::api::LOC_T *vec);
00043 
00046       InvFPDocList(lemur::api::TERMID_T id, int len);
00048       InvFPDocList(lemur::utility::MemCache* mc, lemur::api::TERMID_T id, int len);
00049       InvFPDocList(lemur::utility::MemCache* mc, lemur::api::TERMID_T id, int len, lemur::api::DOCID_T docid, lemur::api::LOC_T location);
00051       InvFPDocList(lemur::api::TERMID_T id, int listlen, lemur::api::LOC_T* list, int fr, lemur::api::DOCID_T* ldocid, int len);
00052       ~InvFPDocList();
00053 
00054       bool addTerm(lemur::api::DOCID_T docid);
00055       bool addLocation(lemur::api::DOCID_T docid, lemur::api::LOC_T location);
00056       bool append(InvDocList* tail);
00057 
00058       virtual lemur::api::DocInfo* nextEntry() const;
00059       virtual void nextEntry(lemur::api::DocInfo* info) const;
00060       virtual void nextEntry(InvFPDocInfo* info) const;
00061       virtual lemur::api::COUNT_T termCTF() const;
00062       lemur::api::LOC_T *byteVec(lemur::api::COUNT_T &len);
00063 
00064     protected:
00065       // Helper functions for iterator, subclasses should override
00067       virtual lemur::api::DocInfo* newElement() const { return new InvFPDocInfo(); }
00069       virtual lemur::api::DocInfo* getElement(lemur::api::DocInfo* elem, lemur::api::POS_T position) const;
00071       virtual void assignElement(lemur::api::DocInfo* to, lemur::api::DocInfo* from) const { 
00072         *static_cast<InvFPDocInfo*>(to) = *static_cast<InvFPDocInfo*>(from); 
00073       }
00075       virtual lemur::api::POS_T nextPosition(lemur::api::POS_T position) const;
00076 
00079       virtual void deltaEncode();
00080 
00083       virtual void deltaDecode();
00084 
00085     private:
00086       mutable InvFPDocInfo entry;
00087     };
00088   }
00089 }
00090 
00091 #endif

Generated on Tue Jun 15 11:02:54 2010 for Lemur by doxygen 1.3.4