From 06d0d5cc15bfc18748030b1ddcf5329d850a76f1 Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 17 Aug 2010 22:05:54 +0000 Subject: vest generate / map vector print / read compatability git-svn-id: https://ws10smt.googlecode.com/svn/trunk@584 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/mr_vest_generate_mapper_input.cc | 11 ++++++++--- vest/mr_vest_map.cc | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/vest/mr_vest_generate_mapper_input.cc b/vest/mr_vest_generate_mapper_input.cc index e6cf3faa..68191a6a 100644 --- a/vest/mr_vest_generate_mapper_input.cc +++ b/vest/mr_vest_generate_mapper_input.cc @@ -85,8 +85,13 @@ struct oracle_directions { void Print() { for (int i = 0; i < dev_set_size; ++i) - for (int j = 0; j < directions.size(); ++j) - cout << forest_file(i) <<" " << i << ' ' << origin << ' ' << directions[j] << endl; + for (int j = 0; j < directions.size(); ++j) { + cout << forest_file(i) <<" " << i<<" "; + origin.print(cout,"=",";"); + cout<<" "; + directions[j].print(cout,"=",";"); + cout<<"\n"; + } } void AddOptions(po::options_description *opts) { @@ -117,7 +122,7 @@ struct oracle_directions { po::store(parse_command_line(argc, argv, dcmdline_options), *conf); po::notify(*conf); if (conf->count("dev_set_size") == 0) { - cerr << "Please specify the size of the development set using -d N\n"; + cerr << "Please specify the size of the development set using -s N\n"; goto bad_cmdline; } if (conf->count("weights") == 0) { diff --git a/vest/mr_vest_map.cc b/vest/mr_vest_map.cc index 1506a99f..71dda6d7 100644 --- a/vest/mr_vest_map.cc +++ b/vest/mr_vest_map.cc @@ -43,6 +43,11 @@ void InitCommandLine(int argc, char** argv, po::variables_map* conf) { } bool ReadSparseVectorString(const string& s, SparseVector* v) { +#if 0 + // this should work, but untested. + std::istringstream i(s); + i>>*v; +#else vector fields; Tokenize(s, ';', &fields); if (fields.empty()) return false; @@ -56,6 +61,7 @@ bool ReadSparseVectorString(const string& s, SparseVector* v) { v->set_value(FD::Convert(pair[0]), atof(pair[1].c_str())); } return true; +#endif } int main(int argc, char** argv) { -- cgit v1.2.3