summaryrefslogtreecommitdiff
path: root/vest/mr_vest_map.cc
diff options
context:
space:
mode:
Diffstat (limited to 'vest/mr_vest_map.cc')
-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;