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:
bojar 2007-03-21 00:52:28 +00:00
parent 2f210366f6
commit d4b1103bd7

View File

@ -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();