diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-01-14 14:07:42 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-01-14 14:07:42 +0300 |
commit | 05ead45e71916c5763c5c4b6375e2ca6838f3995 (patch) | |
tree | c279bd4aacfb31758720ffbaf5aaf62022574a52 /moses/TargetPhrase.cpp | |
parent | 91cb549ccf09fc33122f3d531f47c38ad0e99b3d (diff) |
beautify
Diffstat (limited to 'moses/TargetPhrase.cpp')
-rw-r--r-- | moses/TargetPhrase.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp index 945c3f3d4..2309b1415 100644 --- a/moses/TargetPhrase.cpp +++ b/moses/TargetPhrase.cpp @@ -160,11 +160,12 @@ void TargetPhrase::EvaluateWithSourceContext(const InputType &input, const Input m_fullScore = weightedScore + m_futureScore; } -void TargetPhrase::UpdateScore(ScoreComponentCollection* futureScoreBreakdown) { +void TargetPhrase::UpdateScore(ScoreComponentCollection* futureScoreBreakdown) +{ float weightedScore = m_scoreBreakdown.GetWeightedScore(); if(futureScoreBreakdown) m_futureScore += futureScoreBreakdown->GetWeightedScore(); - m_fullScore = weightedScore + m_futureScore; + m_fullScore = weightedScore + m_futureScore; } void TargetPhrase::SetXMLScore(float score) @@ -301,23 +302,23 @@ std::ostream& operator<<(std::ostream& os, const TargetPhrase& tp) os << ": nonterm=" << tp.GetAlignNonTerm() << flush; os << ": c=" << tp.m_fullScore << flush; os << " " << tp.m_scoreBreakdown << flush; - + const Phrase *sourcePhrase = tp.GetRuleSource(); if (sourcePhrase) { os << " sourcePhrase=" << *sourcePhrase << flush; } if (tp.m_properties.size()) { - os << " properties: " << flush; + os << " properties: " << flush; - TargetPhrase::Properties::const_iterator iter; - for (iter = tp.m_properties.begin(); iter != tp.m_properties.end(); ++iter) { - const string &key = iter->first; - const PhraseProperty *prop = iter->second.get(); - assert(prop); + TargetPhrase::Properties::const_iterator iter; + for (iter = tp.m_properties.begin(); iter != tp.m_properties.end(); ++iter) { + const string &key = iter->first; + const PhraseProperty *prop = iter->second.get(); + assert(prop); - os << key << "=" << *prop << " "; - } + os << key << "=" << *prop << " "; + } } return os; |