void Pretreatment::paperDatePretreat(string path) { int max = 0, min = INT_MAX; set<string> s; PaperReader pr(path); Paper p; while(pr.getNextPaper(p)) { cout<<p.getIndex()<<endl; if(p.getYear() < min && p.getYear() != 0) { min = p.getYear(); } if(p.getYear() > max) { max = p.getYear(); } s.insert(p.getVenue()); } ofstream fout; fout.open("./paperResult_2000", ios::out); fout<<"min : "<<min<<" max : "<<max<<endl; set<string>::iterator it; for(it=s.begin(); it != s.end(); it++) { fout<<*it<<endl; } fout.close(); }
void Pretreatment::countPaper(std::string path) { int num[100] = {0}; PaperReader pr(path); Paper p; while(pr.getNextPaper(p)) { cout<<p.getIndex()<<endl; if(p.getYear() != 0) { num[p.getYear()-1936]++; } } ofstream fout; fout.open("./paperCount", ios::out); for(int i = 0; i < 100; i++) { fout<<i+1936<<" "<<num[i]<<endl; } fout.close(); }