-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypeSearch.cpp
87 lines (87 loc) · 1.96 KB
/
typeSearch.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//#include<fstream>
//#include<iostream>
//#include<string>
//#include<stdio.h>
//#include<sstream>
//#include<vector>
//#define SIZE 40000
//#define INPUTFILE "C:\\Users\\root\\Desktop\\TensorFlow\\¾«×¼×ÊÖú\\train\\card_train.txt"
//
//using namespace std;
//
//int main(){
// ifstream file(INPUTFILE, ios::in | ios::binary);
// vector<string> consumeType;
// vector<string> placeType;
// vector<string> goodType;
//
// if (!file){
// cout << "file open fail" << endl;
// return 0;
// }
//
// string str;
// string consume;
// string place;
// string good;
// int cnt = 0;
//
// while (getline(file, str)){
// size_t pos = 0;
// size_t beg = 0;
//
// pos = str.find(',', pos) + 1; //skip id
//
// beg = pos;
// pos = str.find(",", pos);
// consume = str.substr(beg, pos - beg);
//
// beg = pos + 1;
// pos = str.find(",", beg);
// place = str.substr(beg, pos - beg);
//
// beg = pos + 1;
// pos = str.find(",", beg);
// good = str.substr(beg, pos - beg);
//
// if (find(consumeType.begin(), consumeType.end(), consume) == consumeType.end()){
// consumeType.push_back(consume);
// }
//
// if (find(placeType.begin(), placeType.end(), place) == placeType.end()){
// placeType.push_back(place);
// }
//
// if (find(goodType.begin(), goodType.end(), good) == goodType.end()){
// goodType.push_back(good);
// }
//
// cnt++;
// if ((cnt % 3000) == 0){
// cout << cnt << endl;
// cout << "consume " << consumeType.size() << " place " << placeType.size() << " good " << goodType.size() << endl;
// }
//
// if (cnt >= 200000) break;
//}
//
// file.close();
//
// cout << "consume type" << endl;
// for (int i = 0; i < consumeType.size(); i++){
// cout << consumeType[i] << ' ';
// }
// cout << endl;
//
// cout << "place type" << endl;
// for (int i = 0; i < placeType.size(); i++){
// cout << placeType[i] << ' ';
// }
// cout << endl;
//
// cout << "good type" << endl;
// for (int i = 0; i < goodType.size(); i++){
// cout << goodType[i] << ' ';
// }
// cout << endl;
//}