Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2013-05-29 21:16:15 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-05-29 21:16:15 +0400
commit6249432407af8730c10bccc7894c0725fcaf5e47 (patch)
tree3ac1f094b9fdc199b04bc5ef209ce00e3596e37d /phrase-extract/consolidate-direct-main.cpp
parent59bd7deb4b6b9c4f7b3b7dbb055783528fbc31ca (diff)
beautify
Diffstat (limited to 'phrase-extract/consolidate-direct-main.cpp')
-rw-r--r--phrase-extract/consolidate-direct-main.cpp41
1 files changed, 20 insertions, 21 deletions
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;
}