From 832b725c595d586f8802be12588fce9b495d36b8 Mon Sep 17 00:00:00 2001 From: Jun-ya NORIMATSU Date: Mon, 12 Jan 2015 13:20:38 +0900 Subject: [PATCH] clean. --- moses/LM/DALMWrapper.cpp | 13 ++----------- moses/LM/DALMWrapper.h | 1 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/moses/LM/DALMWrapper.cpp b/moses/LM/DALMWrapper.cpp index c6c4a80de..74f9376b8 100644 --- a/moses/LM/DALMWrapper.cpp +++ b/moses/LM/DALMWrapper.cpp @@ -340,8 +340,6 @@ FFState *LanguageModelDALM::EvaluateWhenApplied(const Hypothesis &hypo, const FF } FFState *LanguageModelDALM::EvaluateWhenApplied(const ChartHypothesis& hypo, int featureID, ScoreComponentCollection *out) const{ - // TODO: original authors of this feature function, please check TODOs in this method to reactivate - //UTIL_THROW2("DALM has been temporarily deactivated in the chart decoder, cf. http://thread.gmane.org/gmane.comp.nlp.moses.user/12146"); // initialize language model context state DALMChartState *newState = new DALMChartState(); DALM::State &state = newState->GetRightContext(); @@ -382,9 +380,6 @@ FFState *LanguageModelDALM::EvaluateWhenApplied(const ChartHypothesis& hypo, int (*newState) = (*prevState); hypoSizeAll = hypoSize+prevState->GetHypoSize()-1; - // get hypoScore - // hypoScore = UntransformLMScore(prevHypo->GetScoreBreakdown().GetScoresForProducer(this)[0]); // TODO: Check whether this (and the below) modification is sufficient to fix the method to conform with feature score deltas in the chart decoder: https://github.com/moses-smt/mosesdecoder/commit/465b47566424efb707bdc063d0bff52b0650eb0a . It's likely that you'll also have to adapt EvaluateNonTerminal() and/or EvaluateTerminal() - phrasePos++; } } @@ -412,21 +407,19 @@ FFState *LanguageModelDALM::EvaluateWhenApplied(const ChartHypothesis& hypo, int const DALMChartState* prevState = static_cast(prevHypo->GetFFState(featureID)); size_t prevTargetPhraseLength = prevHypo->GetCurrTargetPhrase().GetSize(); - //float prevHypoScore = UntransformLMScore(prevHypo->GetScoreBreakdown().GetScoresForProducer(this)[0]); hypoSizeAll += prevState->GetHypoSize()-1; EvaluateNonTerminal( word, hypoScore, newState, state, prefixFragments, prefixLength, - prevState, prevTargetPhraseLength //, prevHypoScore + prevState, prevTargetPhraseLength ); } } // assign combined score to score breakdown - // out->Assign(this, TransformLMScore(hypoScore)); - out->PlusEquals(this, TransformLMScore(hypoScore)); // TODO: Check whether this (and the above) modification is sufficient to fix the method to conform with feature score deltas in the chart decoder: https://github.com/moses-smt/mosesdecoder/commit/465b47566424efb707bdc063d0bff52b0650eb0a . It's likely that you'll also have to adapt EvaluateNonTerminal() and/or EvaluateTerminal() + out->PlusEquals(this, TransformLMScore(hypoScore)); return newState; } @@ -525,12 +518,10 @@ void LanguageModelDALM::EvaluateNonTerminal( unsigned char &prefixLength, const DALMChartState *prevState, size_t prevTargetPhraseLength - //float prevHypoScore ) const{ const unsigned char prevPrefixLength = prevState->GetPrefixLength(); const DALM::Fragment *prevPrefixFragments = prevState->GetPrefixFragments(); - //hypoScore += prevHypoScore; if(prevPrefixLength == 0){ newState->SetAsLarge(); diff --git a/moses/LM/DALMWrapper.h b/moses/LM/DALMWrapper.h index 8122c3dc1..fe724e7c8 100644 --- a/moses/LM/DALMWrapper.h +++ b/moses/LM/DALMWrapper.h @@ -95,7 +95,6 @@ private: unsigned char &prefixLength, const DALMChartState *prevState, size_t prevTargetPhraseLength - //float prevHypoScore ) const; };