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

ResultFile.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.cs.cmu.edu/~lemur/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 #ifndef _RESULTFILE_HPP
00014 #define _RESULTFILE_HPP
00015 
00016 #include "common_headers.hpp"
00017 #include "Index.hpp"
00018 #include "IndexedReal.hpp"
00019 
00021 
00022 class ResultFile {
00023 public:
00024   ResultFile(bool TRECFormat = true) : trecFmt (TRECFormat) {
00025   }
00026   
00027   ~ResultFile() {}
00028 
00030   void openForRead(istream &is, Index &index);
00031   
00033   void getResult(char *expectedQID, IndexedRealVector &res);
00034   
00036   void openForWrite( ostream &os, Index &index) {
00037     
00038     outStr = &os;
00039     ind = &index;
00040   }
00041 
00043 
00044   void writeResults(char *queryID, IndexedRealVector *results, int maxCountOfResult);
00045   
00046 private:
00047 
00048   bool readLine();
00049 
00050   bool trecFmt;
00051 
00052   char curQID[300];
00053   char curDID[300];
00054   double curSC;
00055   Index *ind;
00056   istream *inStr;
00057   ostream *outStr;
00058   bool eof;
00059 
00060 };
00061 
00062 
00063 #endif /* _RESULTFILE_HPP */
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 

Generated at Fri Jul 26 18:25:22 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000