diff options
| author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-06 17:37:46 +0000 | 
|---|---|---|
| committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-06 17:37:46 +0000 | 
| commit | 4519982e58dc48860f3ed70e46ecbe763d04739f (patch) | |
| tree | 8fc4cacd01333185e352dff1fa06391634300dd5 | |
| parent | 26542e63701322640fd72ce8e080e08ec43e26fd (diff) | |
mapper -i argument for debugging
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@153 ec762483-ff6d-05da-a07a-a48fb63a330f
| -rw-r--r-- | vest/mr_vest_map.cc | 7 | 
1 files changed, 5 insertions, 2 deletions
| 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<vector<string> >(), "[REQD] Reference translation (tokenized text)")          ("source,s",po::value<string>(), "Source file (ignored, except for AER)")          ("loss_function,l",po::value<string>()->default_value("ibm_bleu"), "Loss function being optimized") +    ("input,i",po::value<string>()->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<string>()); +  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; | 
