diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-10-03 15:30:18 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-10-03 15:30:18 +0400 |
commit | 056913df5780b1094dffdf2e0961a89513a1c6fa (patch) | |
tree | ffed67d779346086c96f85730a62459533e86462 | |
parent | fe9a2561a3640666555d6357b0805d3da0a84da7 (diff) |
delete nbestOut
-rw-r--r-- | moses-cmd/Main.cpp | 17 | ||||
-rw-r--r-- | moses/IOWrapper.h | 5 |
2 files changed, 6 insertions, 16 deletions
diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp index f78c71acd..3751a597e 100644 --- a/moses-cmd/Main.cpp +++ b/moses-cmd/Main.cpp @@ -139,24 +139,9 @@ int main(int argc, char** argv) // 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> nbestOut; auto_ptr<ofstream> latticeSamplesOut; - size_t nbestSize = staticData.GetNBestSize(); - string nbestFile = staticData.GetNBestFilePath(); bool output1best = true; - if (nbestSize) { - if (nbestFile == "-" || nbestFile == "/dev/stdout") { - // nbest to stdout, no 1-best - output1best = false; - } else { - // nbest to file, 1-best to stdout - nbestOut.reset(new ofstream(nbestFile.c_str())); - if (!nbestOut->good()) { - TRACE_ERR("ERROR: Failed to open " << nbestFile << " for nbest lists" << endl); - exit(1); - } - } - } + size_t latticeSamplesSize = staticData.GetLatticeSamplesSize(); string latticeSamplesFile = staticData.GetLatticeSamplesFilePath(); if (latticeSamplesSize) { diff --git a/moses/IOWrapper.h b/moses/IOWrapper.h index 813407706..1c962a7c6 100644 --- a/moses/IOWrapper.h +++ b/moses/IOWrapper.h @@ -91,6 +91,7 @@ protected: Moses::OutputCollector *m_searchGraphOutputCollector; Moses::OutputCollector *m_detailedTranslationCollector; Moses::OutputCollector *m_wordGraphCollector; + Moses::OutputCollector *m_latticeSamplesCollector; public: IOWrapper(const std::vector<Moses::FactorType> &inputFactorOrder @@ -139,6 +140,10 @@ public: return m_wordGraphCollector; } + Moses::OutputCollector *GetLatticeSamplesCollector() { + return m_latticeSamplesCollector; + } + }; IOWrapper *GetIOWrapper(const Moses::StaticData &staticData); |