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
path: root/symal
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-05-10 12:19:26 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-05-10 12:19:26 +0300
commit4f02f19ab43f8f566bc621943a2be8fa95edf45c (patch)
treee09a98a8d2c7c6c503b538dbddadf2ee2f2bfbd2 /symal
parent91e699f90d677e7a36cf7fd9a4504b9738ad37bb (diff)
beautify
Diffstat (limited to 'symal')
-rw-r--r--symal/cmd.h3
-rw-r--r--symal/symal.cpp26
2 files changed, 12 insertions, 17 deletions
diff --git a/symal/cmd.h b/symal/cmd.h
index 09f3bf9c5..71b2cd94a 100644
--- a/symal/cmd.h
+++ b/symal/cmd.h
@@ -5,8 +5,7 @@
#define CMD_H
-enum CommandType
-{
+enum CommandType {
CMDDOUBLETYPE = 1,
CMDENUMTYPE,
CMDINTTYPE,
diff --git a/symal/symal.cpp b/symal/symal.cpp
index 76749bc9e..e1108d236 100644
--- a/symal/symal.cpp
+++ b/symal/symal.cpp
@@ -20,8 +20,7 @@ const int MAX_WORD = 10000; // maximum lengthsource/target strings
const int MAX_M = 400; // maximum length of source strings
const int MAX_N = 400; // maximum length of target strings
-enum Alignment
-{
+enum Alignment {
UNION = 1,
INTERSECT,
GROW,
@@ -429,25 +428,24 @@ int main(int argc, char** argv)
istream *inp = &std::cin;
ostream *out = &std::cout;
- try
- {
+ try {
if (input) {
fstream *fin = new fstream(input,ios::in);
if (!fin->is_open()) throw runtime_error("cannot open " + string(input));
inp = fin;
}
-
+
if (output) {
fstream *fout = new fstream(output,ios::out);
if (!fout->is_open()) throw runtime_error("cannot open " + string(output));
out = fout;
}
-
+
int a[MAX_M],b[MAX_N],m,n;
fa=new int[MAX_M+1];
ea=new int[MAX_N+1];
-
-
+
+
int sents = 0;
A=new int *[MAX_N+1];
for (int i=1; i<=MAX_N; i++) A[i]=new int[MAX_M+1];
@@ -473,14 +471,14 @@ int main(int argc, char** argv)
cerr << "symal: computing grow alignment: diagonal ("
<< diagonal << ") final ("<< isfinal << ")"
<< "both-uncovered (" << bothuncovered <<")\n";
-
+
while(getals(*inp,m,a,n,b))
printgrow(*out,m,a,n,b,diagonal,isfinal,bothuncovered);
-
+
break;
case TGTTOSRC:
cerr << "symal: computing target-to-source alignment\n";
-
+
while(getals(*inp,m,a,n,b)) {
printtgttosrc(*out,m,a,n,b);
sents++;
@@ -489,7 +487,7 @@ int main(int argc, char** argv)
break;
case SRCTOTGT:
cerr << "symal: computing source-to-target alignment\n";
-
+
while(getals(*inp,m,a,n,b)) {
printsrctotgt(*out,m,a,n,b);
sents++;
@@ -511,9 +509,7 @@ int main(int argc, char** argv)
if (out != &std::cout) {
delete inp;
}
- }
- catch (const std::exception &e)
- {
+ } catch (const std::exception &e) {
cerr << e.what() << std::endl;
exit(1);
}