-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·54 lines (34 loc) · 1.05 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include "QueryProcessor.h"
#include "Query.h"
#include <boost/date_time/posix_time/posix_time.hpp>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
string path="/home/daniel/Desktop/C++/Assignment/data (copy)";
cout << "Welcome to the IR system by qsz13!"<< endl;
cout << "Please type in the path(left blank for debug mode):" << endl;
string p;
getline(cin,p);
if(p != "")
{
path = p;
}
boost::posix_time::ptime time1,time_now;
boost::posix_time::millisec_posix_time_system_config::time_duration_type time_elapse;
time1 = boost::posix_time::microsec_clock::universal_time();
QueryProcessor c(path);
time_now = boost::posix_time::microsec_clock::universal_time();
time_elapse = time_now - time1;
long milliseconds = time_elapse.total_milliseconds();
cout<<"time_elapse :"<<milliseconds<<"ms"<<endl;
bool flag = 1;
while(flag)
{
flag = c.searchQuery();
//c.getResult();
}
cout << "quit!";
return 0;
}