summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-06 17:37:46 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-06 17:37:46 +0000
commit6a015a6dea93394af3ed9f26d78d265b50b3ba9f (patch)
treec9381c958e0581d475062d4dd4369547c400f6f9
parent6a26a0246e53effd0217ea1443ffbd2e76aae205 (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.cc7
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;