mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-26 11:28:48 +03:00
make sure int are cast to float
This commit is contained in:
parent
31a5b78b91
commit
a27835727e
@ -104,7 +104,7 @@ float SpanLengthPhraseProperty::GetProb(size_t ntInd, size_t sourceWidth, float
|
||||
|
||||
if (map.size() == 0) {
|
||||
// should this ever be reached? there shouldn't be any span length proprty so FF shouldn't call this
|
||||
return 1;
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
Map::const_iterator iter = map.find(sourceWidth);
|
||||
@ -116,7 +116,7 @@ float SpanLengthPhraseProperty::GetProb(size_t ntInd, size_t sourceWidth, float
|
||||
}
|
||||
count += smoothing;
|
||||
|
||||
float total = data.second + smoothing * map.size();
|
||||
float total = data.second + smoothing * (float) map.size();
|
||||
float ret = count / total;
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user