From cf4f5018c5cb75d3ab3fd5b621b9136c68cd7650 Mon Sep 17 00:00:00 2001 From: MichaelAuli Date: Wed, 5 Nov 2008 10:34:34 +0000 Subject: [PATCH] undo translationoption changes git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/branches/auli_constraint@1936 1f5c12ca-751b-0410-a591-d2e778427230 --- moses/src/Manager.cpp | 4 ---- moses/src/TranslationOptionCollection.h | 16 ++++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/moses/src/Manager.cpp b/moses/src/Manager.cpp index 3e208a1af..6443e2c15 100644 --- a/moses/src/Manager.cpp +++ b/moses/src/Manager.cpp @@ -86,15 +86,11 @@ void Manager::ProcessSentence() const vector &decodeStepVL = staticData.GetDecodeStepVL(); - long sentenceID = m_source.GetTranslationId(); - m_constraint = staticData.GetConstrainingPhrase(sentenceID); - // create list of all possible translations // this is only valid if: // 1. generation of source sentence is not done 1st // 2. initial hypothesis factors are given in the sentence //CreateTranslationOptions(m_source, phraseDictionary, lmListInitial); -// m_transOptColl->CreateTranslationOptions(decodeStepVL, m_constraint); m_transOptColl->CreateTranslationOptions(decodeStepVL); m_search->ProcessSentence(); } diff --git a/moses/src/TranslationOptionCollection.h b/moses/src/TranslationOptionCollection.h index 9e65d81fc..cc4c86e00 100644 --- a/moses/src/TranslationOptionCollection.h +++ b/moses/src/TranslationOptionCollection.h @@ -47,7 +47,7 @@ class Word; * all lead to the same decoding algorithm: hypotheses are expanded * by applying phrase translations, which can be precomputed. * - * The precomputation of a collection of instances of such TranslationOption + * The precomputation of a collection of instances of such TranslationOption * depends on the input condition, but they all are presented to * decoding algorithm in the same form, using this class. * @@ -67,9 +67,9 @@ protected: SquareMatrix m_futureScore; /*< matrix of future costs for contiguous parts (span) of the input */ const size_t m_maxNoTransOptPerCoverage; /*< maximum number of translation options per input span (phrase???) */ std::vector m_unksrcs; - + TranslationOptionCollection(InputType const& src, size_t maxNoTransOptPerCoverage); - + void CalcFutureScore(); //! Force a creation of a translation option where there are none for a particular source position. @@ -119,18 +119,18 @@ public: //! Create all possible translations from the phrase tables virtual void CreateTranslationOptions(const std::vector &decodeStepVL); - //! Create translation options that exactly cover a specific input span. + //! Create translation options that exactly cover a specific input span. virtual void CreateTranslationOptionsForRange(const DecodeGraph &decodeStepList , size_t startPosition , size_t endPosition , bool adhereTableLimit); - + //!Check if this range has XML options virtual bool HasXmlOptionsOverlappingRange(size_t startPosition, size_t endPosition) const; - + //! Create xml-based translation options for the specific input span virtual void CreateXmlOptionsForRange(size_t startPosition, size_t endPosition); - + //! returns future cost matrix for sentence inline virtual const SquareMatrix &GetFutureScore() const @@ -144,7 +144,7 @@ public: return GetTranslationOptionList(coverage.GetStartPos(), coverage.GetEndPos()); } - TO_STRING(); + TO_STRING(); }; }