#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace boost::algorithm; void transform_to_svm_template(string& type, string& c, string& trainOrtest, string& creature, string& today) { for(int i = 20; i <= 20; i+=10) { string str_i = boost::lexical_cast(i); // string ipfile = "word_data/c10_test"+str_i+"_celltype_curated_2-4gramfeature.txt"; // string opfile = "word_data/c10_test"+str_i+"_celltype_curated_2-4gramfeature_svm.txt"; string ipfile = "word_data/"+creature+"/"+today+"/c"+c+"_unclassified_"+trainOrtest+"_"+type+"_2-4gramfeature.txt"; string opfile = "word_data/"+creature+"/"+today+"/c"+c+"_unclassified_"+trainOrtest+"_"+type+"_2-4gramfeature_svm.txt"; ifstream f(ipfile.c_str()); ofstream of(opfile.c_str()); string line; while (getline(f, line)) { vector split_feature; split(split_feature, line, is_space(), token_compress_on); int cnt = 1; for(int i = 0; i < split_feature.size()-1; i++) { of<(argv[1]); string c = boost::lexical_cast(argv[2]); string trainOrtest = boost::lexical_cast(argv[3]); string creature = boost::lexical_cast(argv[4]); string today = boost::lexical_cast(argv[5]); transform_to_svm_template(type, c, trainOrtest, creature, today); }