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/moses/PP
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2014-06-10 14:18:14 +0400
committerHieu Hoang <hieuhoang@gmail.com>2014-06-10 14:18:14 +0400
commita27835727ea4ec06296f6aa7edd36c5f3a144e19 (patch)
treed41678682e96e1dad345ed76535de81e4a1be6a7 /moses/PP
parent31a5b78b91300245f34d4154b721af445b141f2a (diff)
make sure int are cast to float
Diffstat (limited to 'moses/PP')
-rw-r--r--moses/PP/SpanLengthPhraseProperty.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/moses/PP/SpanLengthPhraseProperty.cpp b/moses/PP/SpanLengthPhraseProperty.cpp
index b2c0c59e7..4bc29713a 100644
--- a/moses/PP/SpanLengthPhraseProperty.cpp
+++ b/moses/PP/SpanLengthPhraseProperty.cpp
@@ -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;
}