if the output file for nbest is /dev/stdout, the output of best translation is suppressed; this simulates the behavior of '-' shortcut

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@2702 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
nicolabertoldi 2010-01-28 13:09:10 +00:00
parent 5713cf79d7
commit 558ff92c33

View File

@ -116,20 +116,21 @@ void IOWrapper::Initialization(const std::vector<FactorType> &inputFactorOrder
// n-best
m_surpressSingleBestOutput = false;
if (nBestSize > 0)
{
if (nBestFilePath == "-")
{
m_nBestStream = &std::cout;
m_surpressSingleBestOutput = true;
}
else
{
std::ofstream *file = new std::ofstream;
m_nBestStream = file;
file->open(nBestFilePath.c_str());
}
}
{
if (nBestFilePath == "-" || nBestFilePath == "/dev/stdout")
{
m_nBestStream = &std::cout;
m_surpressSingleBestOutput = true;
}
else
{
std::ofstream *file = new std::ofstream;
m_nBestStream = file;
file->open(nBestFilePath.c_str());
}
}
// wordgraph output
if (staticData.GetOutputWordGraph())