diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-10-03 18:30:06 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-10-03 18:30:06 +0400 |
commit | 65bd64ca6ab7b3e5ad54e3fc981173fc9fd0744c (patch) | |
tree | 6a3676edc15b75104cdd27555bb78bcb171a0a3e /moses-cmd | |
parent | 62fe00b1a5775dbba1f961e41511dd99b4f946cb (diff) |
move lattice sample collector from Main to IOWrapper
Diffstat (limited to 'moses-cmd')
-rw-r--r-- | moses-cmd/Main.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp index ca251882f..398a3a824 100644 --- a/moses-cmd/Main.cpp +++ b/moses-cmd/Main.cpp @@ -134,30 +134,6 @@ int main(int argc, char** argv) hypergraphOutput.reset(new HypergraphOutput<Manager>(PRECISION)); } - - // initialize output streams - // note: we can't just write to STDOUT or files - // because multithreading may return sentences in shuffled order - auto_ptr<OutputCollector> latticeSamplesCollector; //for lattice samples - auto_ptr<ofstream> latticeSamplesOut; - bool output1best = true; - - size_t latticeSamplesSize = staticData.GetLatticeSamplesSize(); - string latticeSamplesFile = staticData.GetLatticeSamplesFilePath(); - if (latticeSamplesSize) { - if (latticeSamplesFile == "-" || latticeSamplesFile == "/dev/stdout") { - latticeSamplesCollector.reset(new OutputCollector()); - output1best = false; - } else { - latticeSamplesOut.reset(new ofstream(latticeSamplesFile.c_str())); - if (!latticeSamplesOut->good()) { - TRACE_ERR("ERROR: Failed to open " << latticeSamplesFile << " for lattice samples" << endl); - exit(1); - } - latticeSamplesCollector.reset(new OutputCollector(latticeSamplesOut.get())); - } - } - #ifdef WITH_THREADS ThreadPool pool(staticData.ThreadCount()); #endif |