prevent segfault in OSM model when used in factored model with decomposed phrase-tables

This commit is contained in:
Hieu Hoang 2013-08-16 16:37:40 +01:00
parent 55bd87d38c
commit 4d2fea9b38
2 changed files with 7 additions and 3 deletions

View File

@ -246,4 +246,10 @@ void OpSequenceModel::SetParameter(const std::string& key, const std::string& va
}
}
bool OpSequenceModel::IsUseable(const FactorMask &mask) const
{
bool ret = mask[0];
return ret;
}
} // namespace

View File

@ -49,9 +49,7 @@ public:
std::vector<float> GetFutureScores(const Phrase &source, const Phrase &target) const;
void SetParameter(const std::string& key, const std::string& value);
bool IsUseable(const FactorMask &mask) const {
return true;
}
bool IsUseable(const FactorMask &mask) const;
protected:
typedef std::pair<Phrase, Phrase> ParallelPhrase;