From 80709221a46cf40c7dd7c9daa5f68660afa4d61e Mon Sep 17 00:00:00 2001 From: hieuhoang1972 Date: Sun, 21 Oct 2007 20:56:23 +0000 Subject: visual studio project & minor code clean git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk/moses@1475 1f5c12ca-751b-0410-a591-d2e778427230 --- moses.vcproj | 4 ---- src/Manager.cpp | 14 +++++++------- src/Manager.h | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/moses.vcproj b/moses.vcproj index 33438e35b..54058d1a4 100755 --- a/moses.vcproj +++ b/moses.vcproj @@ -578,10 +578,6 @@ RelativePath=".\src\PhraseDictionaryTreeAdaptor.cpp" > - - diff --git a/src/Manager.cpp b/src/Manager.cpp index 4f72a55b3..479292474 100755 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -47,7 +47,7 @@ static bool debug2 = false; Manager::Manager(InputType const& source) :m_source(source) ,m_hypoStackColl(source.GetSize() + 1) -,m_possibleTranslations(source.CreateTranslationOptionCollection()) +,m_transOptColl(source.CreateTranslationOptionCollection()) ,m_initialTargetPhrase(Output) ,m_start(clock()) { @@ -66,7 +66,7 @@ Manager::Manager(InputType const& source) Manager::~Manager() { - delete m_possibleTranslations; + delete m_transOptColl; StaticData::Instance().CleanUpAfterSentenceProcessing(); clock_t end = clock(); @@ -92,7 +92,7 @@ void Manager::ProcessSentence() // 1. generation of source sentence is not done 1st // 2. initial hypothesis factors are given in the sentence //CreateTranslationOptions(m_source, phraseDictionary, lmListInitial); - m_possibleTranslations->CreateTranslationOptions(decodeStepVL); + m_transOptColl->CreateTranslationOptions(decodeStepVL); // initial seed hypothesis: nothing translated, no words produced { @@ -155,7 +155,7 @@ void Manager::ProcessOneHypothesis(const Hypothesis &hypothesis) if (!hypoBitmap.Overlap(WordsRange(startPos, endPos))) { ExpandAllHypotheses(hypothesis - , m_possibleTranslations->GetTranslationOptionList(WordsRange(startPos, endPos))); + , m_transOptColl->GetTranslationOptionList(WordsRange(startPos, endPos))); } } } @@ -234,7 +234,7 @@ void Manager::ProcessOneHypothesis(const Hypothesis &hypothesis) if (debug2) { std::cerr << "Ext!\n"; StaticData::Instance().SetVerboseLevel(4); } #endif ExpandAllHypotheses(hypothesis - ,m_possibleTranslations->GetTranslationOptionList(extRange)); + ,m_transOptColl->GetTranslationOptionList(extRange)); #ifdef DEBUGLATTICE StaticData::Instance().SetVerboseLevel(vl); #endif @@ -255,7 +255,7 @@ void Manager::ProcessOneHypothesis(const Hypothesis &hypothesis) if (required_distortion <= maxDistortion) { ExpandAllHypotheses(hypothesis - ,m_possibleTranslations->GetTranslationOptionList(extRange)); + ,m_transOptColl->GetTranslationOptionList(extRange)); } #ifdef DEBUGLATTICE else @@ -295,7 +295,7 @@ void Manager::ExpandHypothesis(const Hypothesis &hypothesis, const TranslationOp if (debug2) { std::cerr << "::EXT: " << transOpt << "\n"; } #endif Hypothesis *newHypo = hypothesis.CreateNext(transOpt); - newHypo->CalcScore(m_possibleTranslations->GetFutureScore()); + newHypo->CalcScore(m_transOptColl->GetFutureScore()); // logging for the curious IFVERBOSE(3) { diff --git a/src/Manager.h b/src/Manager.h index 01e37016c..6c1383e0d 100755 --- a/src/Manager.h +++ b/src/Manager.h @@ -77,7 +77,7 @@ protected: std::vector < HypothesisStack > m_hypoStackColl; /**< stacks to store hypothesis (partial translations) */ // no of elements = no of words in source + 1 - TranslationOptionCollection *m_possibleTranslations; /**< pre-computed list of translation options for the phrases in this sentence */ + TranslationOptionCollection *m_transOptColl; /**< pre-computed list of translation options for the phrases in this sentence */ TargetPhrase m_initialTargetPhrase; /**< used to seed 1st hypo */ clock_t m_start; /**< starting time, used for logging */ -- cgit v1.2.3