mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 07:42:21 +03:00
Fixed the case when the intersection of two alignments is empty. Used to throw
std::out_of_range at basic_string::replace, now emits an empty line. git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1320 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
2f210366f6
commit
d4b1103bd7
@ -150,7 +150,10 @@ int printersect(fstream& out,int m,int *a,int n,int* b){
|
||||
|
||||
//fix the last " "
|
||||
string str = sout.str();
|
||||
str.replace(str.length()-1,1,"\n");
|
||||
if (str.length() == 0)
|
||||
str = "\n";
|
||||
else
|
||||
str.replace(str.length()-1,1,"\n");
|
||||
|
||||
out << str;
|
||||
out.flush();
|
||||
|
Loading…
Reference in New Issue
Block a user