diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-06-10 13:44:25 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-06-10 13:44:25 +0400 |
commit | 31a5b78b91300245f34d4154b721af445b141f2a (patch) | |
tree | b84d3a5db04745cc27059301ecc2b17df5de7c0a /moses/PP | |
parent | 8c55f98c7acb8820fdee8e9abe62a5862d6301b3 (diff) |
bug in SpanLength FF
Diffstat (limited to 'moses/PP')
-rw-r--r-- | moses/PP/SpanLengthPhraseProperty.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/moses/PP/SpanLengthPhraseProperty.cpp b/moses/PP/SpanLengthPhraseProperty.cpp index c48209976..b2c0c59e7 100644 --- a/moses/PP/SpanLengthPhraseProperty.cpp +++ b/moses/PP/SpanLengthPhraseProperty.cpp @@ -101,6 +101,12 @@ float SpanLengthPhraseProperty::GetProb(size_t ntInd, size_t sourceWidth, float const std::pair<Map, float> &data = m_source[ntInd]; const Map &map = data.first; + + 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; + } + Map::const_iterator iter = map.find(sourceWidth); if (iter == map.end()) { count = 0; |