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

DocumentRep.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 _DOCUMENTREP_HPP
00014 #define _DOCUMENTREP_HPP
00015 
00016 #include "DocInfoList.hpp"
00017 
00018 //------------------------------------------------------------
00019 //      Abstract Interface for Document Representation 
00020 //------------------------------------------------------------
00021 
00023 
00024 class DocumentRep {
00025 public:
00026   DocumentRep(DOCID_T docID, int dl = 1) : id(docID), docLength(dl) {}
00027   virtual ~DocumentRep() {}
00028 
00030   virtual double termWeight(TERMID_T termID, const DocInfo *info) const = 0;
00031 
00033   virtual double scoreConstant() const = 0 ;
00036   void setDocLength(int len) { docLength = len;}
00037 
00040   int getDocLength() const { return docLength;}
00043   DOCID_T getID() const { return id;}
00044   
00045 protected:  
00046   DOCID_T id;
00047   int docLength;
00048 };
00049 #endif /* _DOCUMENTREP_HPP */

Generated on Wed Nov 3 12:58:54 2004 for Lemur Toolkit by doxygen1.2.18