formatting

This commit is contained in:
Matthias Huck 2014-06-06 20:16:40 +01:00
parent 98a117ca37
commit a19aaada06

View File

@ -29,7 +29,7 @@ namespace Moses
CompletedRuleCollection::CompletedRuleCollection() : m_ruleLimit(StaticData::Instance().GetRuleLimit())
{
m_scoreThreshold = numeric_limits<float>::infinity();
m_scoreThreshold = numeric_limits<float>::infinity();
}
// copies some functionality (pruning) from ChartTranslationOptionList::Add
@ -37,25 +37,25 @@ void CompletedRuleCollection::Add(const TargetPhraseCollection &tpc,
const StackVec &stackVec,
const ChartParserCallback &outColl)
{
if (tpc.IsEmpty()) {
return;
}
if (tpc.IsEmpty()) {
return;
}
const TargetPhrase &targetPhrase = **(tpc.begin());
float score = targetPhrase.GetFutureScore();
for (StackVec::const_iterator p = stackVec.begin(); p != stackVec.end(); ++p) {
float stackScore = (*p)->GetBestScore(&outColl);
score += stackScore;
}
const TargetPhrase &targetPhrase = **(tpc.begin());
float score = targetPhrase.GetFutureScore();
for (StackVec::const_iterator p = stackVec.begin(); p != stackVec.end(); ++p) {
float stackScore = (*p)->GetBestScore(&outColl);
score += stackScore;
}
// If the rule limit has already been reached then don't add the option
// unless it is better than at least one existing option.
if (m_ruleLimit && m_collection.size() > m_ruleLimit && score < m_scoreThreshold) {
return;
}
// If the rule limit has already been reached then don't add the option
// unless it is better than at least one existing option.
if (m_ruleLimit && m_collection.size() > m_ruleLimit && score < m_scoreThreshold) {
return;
}
CompletedRule *completedRule = new CompletedRule(tpc, stackVec, score);
m_collection.push_back(completedRule);
CompletedRule *completedRule = new CompletedRule(tpc, stackVec, score);
m_collection.push_back(completedRule);
// If the rule limit hasn't been exceeded then update the threshold.
if (!m_ruleLimit || m_collection.size() <= m_ruleLimit) {