From 6249432407af8730c10bccc7894c0725fcaf5e47 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 29 May 2013 18:16:15 +0100 Subject: beautify --- phrase-extract/consolidate-direct-main.cpp | 41 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'phrase-extract/consolidate-direct-main.cpp') diff --git a/phrase-extract/consolidate-direct-main.cpp b/phrase-extract/consolidate-direct-main.cpp index e7e68e977..3b38f741c 100644 --- a/phrase-extract/consolidate-direct-main.cpp +++ b/phrase-extract/consolidate-direct-main.cpp @@ -89,21 +89,20 @@ int main(int argc, char* argv[]) char* &fileNameConsolidated = argv[2]; ostream *fileConsolidated; - - if (strcmp(fileNameConsolidated, "-") == 0) { - fileConsolidated = &cout; - } - else { + + if (strcmp(fileNameConsolidated, "-") == 0) { + fileConsolidated = &cout; + } else { Moses::OutputFileStream *outputFile = new Moses::OutputFileStream(); - bool success = outputFile->Open(fileNameConsolidated); - if (!success) { - cerr << "ERROR: could not open file phrase table file " - << fileNameConsolidated << endl; - exit(1); - } - fileConsolidated = outputFile; - } - + bool success = outputFile->Open(fileNameConsolidated); + if (!success) { + cerr << "ERROR: could not open file phrase table file " + << fileNameConsolidated << endl; + exit(1); + } + fileConsolidated = outputFile; + } + int i=0; while(true) { i++; @@ -119,8 +118,8 @@ int main(int argc, char* argv[]) // output alignment and probabilities (*fileConsolidated) << itemDirect[2] // prob direct - << " 2.718" // phrase count feature - << " ||| " << itemDirect[3]; // alignment + << " 2.718" // phrase count feature + << " ||| " << itemDirect[3]; // alignment // counts (*fileConsolidated) << "||| 0 " << itemDirect[4]; // indirect @@ -128,11 +127,11 @@ int main(int argc, char* argv[]) } - fileConsolidated->flush(); - if (fileConsolidated != &cout) { - delete fileConsolidated; - } - + fileConsolidated->flush(); + if (fileConsolidated != &cout) { + delete fileConsolidated; + } + cerr << "Finished" << endl; } -- cgit v1.2.3