20int main(
int argc,
char* argv[])
24 cout <<
"Usage: ./renamer <input>" << endl;
27 ifstream input1(argv[1], ifstream::in);
31 string name =
"Renamed_";
32 name += string(argv[1]);
37 while(getline(input1,locline))
39 std::tuple<int64_t, int64_t, string> triple;
41 boost::split(strs, locline, boost::is_any_of(
"\t "));
43 auto ret =
vertexmap.insert(make_pair(strs[0], vertexid));
50 get<0>(triple) = ret.first->second;
52 ret =
vertexmap.insert(make_pair(strs[1], vertexid));
53 if (ret.second) ++vertexid;
55 get<1>(triple) = ret.first->second;
56 get<2>(triple) = strs[2];
59 out << get<0>(triple) <<
"\t" << get<1>(triple) <<
"\t" << get<2>(triple) <<
"\n";
62 string dictname =
"Vertex_Dict_";
63 dictname += string(argv[1]);
64 ofstream dictout(dictname);
68 max = std::max(max, it->second);
69 dictout << it->second <<
"\t" << it ->first << endl;
71 cout << (max+1) <<
"\t" << (max+1) <<
"\t" <<
numlines << endl;