summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-17 22:05:54 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-17 22:05:54 +0000
commit06d0d5cc15bfc18748030b1ddcf5329d850a76f1 (patch)
tree03df9d5f19d5c8cebf4367d8fc0378528e6b81cf
parent4f27006ca3699d28cbdec6e3e8dd44d73afbc3ba (diff)
vest generate / map vector print / read compatability
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@584 ec762483-ff6d-05da-a07a-a48fb63a330f
-rw-r--r--vest/mr_vest_generate_mapper_input.cc11
-rw-r--r--vest/mr_vest_map.cc6
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<double>* v) {
+#if 0
+ // this should work, but untested.
+ std::istringstream i(s);
+ i>>*v;
+#else
vector<string> fields;
Tokenize(s, ';', &fields);
if (fields.empty()) return false;
@@ -56,6 +61,7 @@ bool ReadSparseVectorString(const string& s, SparseVector<double>* v) {
v->set_value(FD::Convert(pair[0]), atof(pair[1].c_str()));
}
return true;
+#endif
}
int main(int argc, char** argv) {