From 4519982e58dc48860f3ed70e46ecbe763d04739f Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 6 Jul 2010 17:37:46 +0000 Subject: mapper -i argument for debugging git-svn-id: https://ws10smt.googlecode.com/svn/trunk@153 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/mr_vest_map.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vest') diff --git a/vest/mr_vest_map.cc b/vest/mr_vest_map.cc index d1ba159f..29e0d2bd 100644 --- a/vest/mr_vest_map.cc +++ b/vest/mr_vest_map.cc @@ -25,6 +25,7 @@ void InitCommandLine(int argc, char** argv, po::variables_map* conf) { ("reference,r",po::value >(), "[REQD] Reference translation (tokenized text)") ("source,s",po::value(), "Source file (ignored, except for AER)") ("loss_function,l",po::value()->default_value("ibm_bleu"), "Loss function being optimized") + ("input,i",po::value()->default_value("-"), "Input file to map (- is STDIN)") ("help,h", "Help"); po::options_description dcmdline_options; dcmdline_options.add(opts); @@ -65,9 +66,11 @@ int main(int argc, char** argv) { cerr << "Loaded " << ds.size() << " references for scoring with " << loss_function << endl; Hypergraph hg; string last_file; - while(cin) { + ReadFile in_read(conf["input"].as()); + istream &in=*in_read.stream(); + while(in) { string line; - getline(cin, line); + getline(in, line); if (line.empty()) continue; istringstream is(line); int sent_id; -- cgit v1.2.3