00001
00002
00003
00004
00005
00006
00007
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
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073