mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
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:
parent
5713cf79d7
commit
558ff92c33
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user