mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-06 03:33:37 +03:00
duplicate n-best stream processing
This commit is contained in:
parent
e41d2ba08b
commit
2468e2108a
@ -97,11 +97,15 @@ IOWrapper::IOWrapper(const std::vector<FactorType> &inputFactorOrder
|
||||
if (nBestSize > 0) {
|
||||
if (nBestFilePath == "-" || nBestFilePath == "/dev/stdout") {
|
||||
m_nBestStream = &std::cout;
|
||||
m_nBestOutputCollector = new Moses::OutputCollector(&std::cout);
|
||||
m_surpressSingleBestOutput = true;
|
||||
} else {
|
||||
std::ofstream *file = new std::ofstream;
|
||||
m_nBestStream = file;
|
||||
file->open(nBestFilePath.c_str());
|
||||
m_nBestStream = file;
|
||||
|
||||
m_nBestOutputCollector = new Moses::OutputCollector(file);
|
||||
//m_nBestOutputCollector->HoldOutputStream();
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,16 +121,6 @@ IOWrapper::IOWrapper(const std::vector<FactorType> &inputFactorOrder
|
||||
file->open(fileName.c_str());
|
||||
}
|
||||
|
||||
if (nBestSize > 0) {
|
||||
if (nBestFilePath == "-") {
|
||||
m_nBestOutputCollector = new Moses::OutputCollector(&std::cout);
|
||||
m_surpressSingleBestOutput = true;
|
||||
} else {
|
||||
m_nBestOutputCollector = new Moses::OutputCollector(new std::ofstream(nBestFilePath.c_str()));
|
||||
m_nBestOutputCollector->HoldOutputStream();
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_surpressSingleBestOutput) {
|
||||
m_singleBestOutputCollector = new Moses::OutputCollector(&std::cout);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user