diff options
Diffstat (limited to 'moses/IOWrapper.cpp')
-rw-r--r-- | moses/IOWrapper.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/moses/IOWrapper.cpp b/moses/IOWrapper.cpp index 26d22a576..a153ac10c 100644 --- a/moses/IOWrapper.cpp +++ b/moses/IOWrapper.cpp @@ -94,9 +94,13 @@ IOWrapper::IOWrapper(const std::vector<FactorType> &inputFactorOrder ,m_outputSearchGraphStream(NULL) ,m_detailedTranslationReportingStream(NULL) ,m_alignmentOutputStream(NULL) + ,m_unknownsStream(NULL) ,m_singleBestOutputCollector(NULL) ,m_nBestOutputCollector(NULL) + ,m_unknownsCollector(NULL) { + const StaticData &staticData = StaticData::Instance(); + Initialization(inputFactorOrder, outputFactorOrder , inputFactorUsed , nBestSize, nBestFilePath); @@ -119,6 +123,14 @@ IOWrapper::IOWrapper(const std::vector<FactorType> &inputFactorOrder m_singleBestOutputCollector = new Moses::OutputCollector(&std::cout); } + if (!staticData.GetOutputUnknownsFile().empty()) { + m_unknownsStream = new std::ofstream(staticData.GetOutputUnknownsFile().c_str()); + m_unknownsCollector = new Moses::OutputCollector(m_unknownsStream); + UTIL_THROW_IF2(!m_unknownsStream->good(), + "File for unknowns words could not be opened: " << + staticData.GetOutputUnknownsFile()); + } + } IOWrapper::~IOWrapper() |