From 069d24e9f5f41f0dabb8d3dbdac7f0f358ac93de Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 11 May 2012 12:25:20 +0100 Subject: [PATCH] zipped output file --- scripts/training/phrase-extract/score.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/training/phrase-extract/score.cpp b/scripts/training/phrase-extract/score.cpp index 4b036f42c..19e487ace 100644 --- a/scripts/training/phrase-extract/score.cpp +++ b/scripts/training/phrase-extract/score.cpp @@ -247,7 +247,6 @@ int main(int argc, char* argv[]) phraseTableFile->flush(); if (phraseTableFile != &cout) { - //(dynamic_cast(phraseTableFile))->close(); delete phraseTableFile; } @@ -260,9 +259,9 @@ int main(int argc, char* argv[]) void writeCountOfCounts( const char* fileNameCountOfCounts ) { // open file - ofstream countOfCountsFile; - countOfCountsFile.open(fileNameCountOfCounts); - if (countOfCountsFile.fail()) { + Moses::OutputFileStream countOfCountsFile; + bool success = countOfCountsFile.Open(fileNameCountOfCounts); + if (!success) { cerr << "ERROR: could not open count-of-counts file " << fileNameCountOfCounts << endl; return; @@ -275,7 +274,7 @@ void writeCountOfCounts( const char* fileNameCountOfCounts ) for(int i=1; i<=COC_MAX; i++) { countOfCountsFile << countOfCounts[ i ] << endl; } - countOfCountsFile.close(); + countOfCountsFile.Close(); } void processPhrasePairs( vector< PhraseAlignment > &phrasePair, ostream &phraseTableFile )