mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 07:42:21 +03:00
Flushing stdout for intersect and union alignments.
(No explicit flushing leads to truncated output! C++ is crap!) Also report the number of sentences processed. git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1319 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
9394f571e6
commit
2f210366f6
@ -131,6 +131,7 @@ int prunionalignment(fstream& out,int m,int *a,int n,int* b){
|
||||
str.replace(str.length()-1,1,"\n");
|
||||
|
||||
out << str;
|
||||
out.flush();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -152,6 +153,7 @@ int printersect(fstream& out,int m,int *a,int n,int* b){
|
||||
str.replace(str.length()-1,1,"\n");
|
||||
|
||||
out << str;
|
||||
out.flush();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -374,17 +376,26 @@ int bothuncovered=false;
|
||||
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];
|
||||
|
||||
switch (alignment){
|
||||
case UNION:
|
||||
cerr << "symal: computing union alignment\n";
|
||||
while(getals(inp,m,a,n,b)) prunionalignment(out,m,a,n,b);
|
||||
while(getals(inp,m,a,n,b)) {
|
||||
prunionalignment(out,m,a,n,b);
|
||||
sents++;
|
||||
}
|
||||
cerr << "Sents: " << sents << endl;
|
||||
break;
|
||||
case INTERSECT:
|
||||
cerr << "symal: computing intersect alignment\n";
|
||||
while(getals(inp,m,a,n,b)) printersect(out,m,a,n,b);
|
||||
while(getals(inp,m,a,n,b)) {
|
||||
printersect(out,m,a,n,b);
|
||||
sents++;
|
||||
}
|
||||
cerr << "Sents: " << sents << endl;
|
||||
break;
|
||||
case GROW:
|
||||
cerr << "symal: computing grow alignment: diagonal ("
|
||||
|
Loading…
Reference in New Issue
Block a user