diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-29 21:16:15 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-29 21:16:15 +0400 |
commit | 6249432407af8730c10bccc7894c0725fcaf5e47 (patch) | |
tree | 3ac1f094b9fdc199b04bc5ef209ce00e3596e37d /moses/MockHypothesis.cpp | |
parent | 59bd7deb4b6b9c4f7b3b7dbb055783528fbc31ca (diff) |
beautify
Diffstat (limited to 'moses/MockHypothesis.cpp')
-rw-r--r-- | moses/MockHypothesis.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/moses/MockHypothesis.cpp b/moses/MockHypothesis.cpp index e98794cb7..826104565 100644 --- a/moses/MockHypothesis.cpp +++ b/moses/MockHypothesis.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -#include "MockHypothesis.h" +#include "MockHypothesis.h" #include <boost/test/unit_test.hpp> @@ -28,19 +28,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA using namespace Moses; using namespace std; -namespace MosesTest { +namespace MosesTest +{ MockHypothesisGuard::MockHypothesisGuard( - const string& sourceSentence, - const vector<Alignment>& alignments, - const vector<string>& targetSegments) -: m_emptyTarget(), - m_sentence(), - m_wp("WordPenalty"), - m_uwp("UnknownWordPenalty"), - m_dist("Distortion"), - m_manager(0,m_sentence,Normal) + const string& sourceSentence, + const vector<Alignment>& alignments, + const vector<string>& targetSegments) + : m_emptyTarget(), + m_sentence(), + m_wp("WordPenalty"), + m_uwp("UnknownWordPenalty"), + m_dist("Distortion"), + m_manager(0,m_sentence,Normal) { BOOST_CHECK_EQUAL(alignments.size(), targetSegments.size()); @@ -49,7 +50,7 @@ MockHypothesisGuard::MockHypothesisGuard( stringstream in(sourceSentence + "\n"); m_sentence.Read(in,factors); - + //Initial empty hypothesis m_manager.ResetSentenceStats(m_sentence); @@ -58,21 +59,20 @@ MockHypothesisGuard::MockHypothesisGuard( //create the chain vector<Alignment>::const_iterator ai = alignments.begin(); vector<string>::const_iterator ti = targetSegments.begin(); - for (; ti != targetSegments.end() && ai != alignments.end(); ++ti,++ai) - { + for (; ti != targetSegments.end() && ai != alignments.end(); ++ti,++ai) { Hypothesis* prevHypo = m_hypothesis; WordsRange wordsRange(ai->first,ai->second); m_targetPhrases.push_back(TargetPhrase()); m_targetPhrases.back().CreateFromString(Input, factors, *ti, "|", NULL); m_toptions.push_back(new TranslationOption - (wordsRange,m_targetPhrases.back())); - m_hypothesis = Hypothesis::Create(*prevHypo,*m_toptions.back(),NULL); + (wordsRange,m_targetPhrases.back())); + m_hypothesis = Hypothesis::Create(*prevHypo,*m_toptions.back(),NULL); } } -MockHypothesisGuard::~MockHypothesisGuard() +MockHypothesisGuard::~MockHypothesisGuard() { RemoveAllInColl(m_toptions); while (m_hypothesis) { |