diff --git a/defer/ExternalFeature.h b/defer/ExternalFeature.h index 6c0fb829e..3a284852d 100644 --- a/defer/ExternalFeature.h +++ b/defer/ExternalFeature.h @@ -51,27 +51,8 @@ public: void SetParameter(const std::string& key, const std::string& value); - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedFutureScore) const { - } - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedFutureScore = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - - FFState* EvaluateWhenApplied( - const Hypothesis& cur_hypo, - const FFState* prev_state, - ScoreComponentCollection* accumulator) const; + FFState* EvaluateWhenApplied(const Hypothesis& cur_hypo, const FFState* prev_state, + ScoreComponentCollection* accumulator) const; FFState* EvaluateWhenApplied( const ChartHypothesis& /* cur_hypo */, diff --git a/moses/FF/BleuScoreFeature.h b/moses/FF/BleuScoreFeature.h index 266d06b68..753d92cf9 100644 --- a/moses/FF/BleuScoreFeature.h +++ b/moses/FF/BleuScoreFeature.h @@ -123,22 +123,6 @@ public: FFState* EvaluateWhenApplied(const ChartHypothesis& cur_hypo, int featureID, ScoreComponentCollection* accumulator) const; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } bool Enabled() const { return m_enabled; diff --git a/moses/FF/ConstrainedDecoding.h b/moses/FF/ConstrainedDecoding.h index 3f28c43e1..769edd80f 100644 --- a/moses/FF/ConstrainedDecoding.h +++ b/moses/FF/ConstrainedDecoding.h @@ -42,24 +42,6 @@ public: return true; } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } - - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/FF/ControlRecombination.h b/moses/FF/ControlRecombination.h index 04f7d441b..034b1a790 100644 --- a/moses/FF/ControlRecombination.h +++ b/moses/FF/ControlRecombination.h @@ -58,23 +58,6 @@ public: return true; } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/FF/CoveredReferenceFeature.cpp b/moses/FF/CoveredReferenceFeature.cpp index d4606a8ec..5e4ada5b0 100644 --- a/moses/FF/CoveredReferenceFeature.cpp +++ b/moses/FF/CoveredReferenceFeature.cpp @@ -30,11 +30,6 @@ bool CoveredReferenceState::operator==(const FFState& other) const } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CoveredReferenceFeature::EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const -{} void CoveredReferenceFeature::EvaluateWithSourceContext(const InputType &input , const InputPath &inputPath diff --git a/moses/FF/CoveredReferenceFeature.h b/moses/FF/CoveredReferenceFeature.h index e6fc79ff7..aedfb3793 100644 --- a/moses/FF/CoveredReferenceFeature.h +++ b/moses/FF/CoveredReferenceFeature.h @@ -53,10 +53,6 @@ public: return new CoveredReferenceState(); } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const; void EvaluateWithSourceContext(const InputType &input , const InputPath &inputPath , const TargetPhrase &targetPhrase @@ -64,10 +60,6 @@ public: , ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection *estimatedScores = NULL) const; - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/FF/DistortionScoreProducer.h b/moses/FF/DistortionScoreProducer.h index 6e6bfbaeb..cfe0dc005 100644 --- a/moses/FF/DistortionScoreProducer.h +++ b/moses/FF/DistortionScoreProducer.h @@ -47,23 +47,6 @@ public: throw std::logic_error("DistortionScoreProducer not supported in chart decoder, yet"); } - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } }; } diff --git a/moses/FF/LexicalReordering/LexicalReordering.h b/moses/FF/LexicalReordering/LexicalReordering.h index c47e7f037..fa2747c82 100644 --- a/moses/FF/LexicalReordering/LexicalReordering.h +++ b/moses/FF/LexicalReordering/LexicalReordering.h @@ -64,28 +64,6 @@ public: UTIL_THROW2("LexicalReordering is not valid for chart decoder"); } - void - EvaluateWithSourceContext - (const InputType &input, - const InputPath &inputPath, - const TargetPhrase &targetPhrase, - const StackVec *stackVec, - ScoreComponentCollection& scoreBreakdown, - ScoreComponentCollection* estimatedScores = NULL) const - { } - - void - EvaluateTranslationOptionListWithSourceContext - (const InputType &input, const TranslationOptionList &transOptList) const - { } - - void - EvaluateInIsolation(const Phrase &source, - const TargetPhrase &targetPhrase, - ScoreComponentCollection &scoreBreakdown, - ScoreComponentCollection &estimatedScores) const - { } - bool GetHaveDefaultScores() { return m_haveDefaultScores; diff --git a/moses/FF/OSM-Feature/OpSequenceModel.h b/moses/FF/OSM-Feature/OpSequenceModel.h index b97450d6b..36a901974 100644 --- a/moses/FF/OSM-Feature/OpSequenceModel.h +++ b/moses/FF/OSM-Feature/OpSequenceModel.h @@ -37,18 +37,6 @@ public: int /* featureID - used to index the state in the previous hypotheses */, ScoreComponentCollection* accumulator) const; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - void EvaluateInIsolation(const Phrase &source , const TargetPhrase &targetPhrase , ScoreComponentCollection &scoreBreakdown diff --git a/moses/FF/PhraseBoundaryFeature.h b/moses/FF/PhraseBoundaryFeature.h index 916225b7d..9e84aaeef 100644 --- a/moses/FF/PhraseBoundaryFeature.h +++ b/moses/FF/PhraseBoundaryFeature.h @@ -54,23 +54,6 @@ public: throw std::logic_error("PhraseBoundaryState not supported in chart decoder, yet"); } - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } - void SetParameter(const std::string& key, const std::string& value); private: diff --git a/moses/FF/PhraseOrientationFeature.h b/moses/FF/PhraseOrientationFeature.h index 82d3928d9..4d9dc20dc 100644 --- a/moses/FF/PhraseOrientationFeature.h +++ b/moses/FF/PhraseOrientationFeature.h @@ -296,18 +296,6 @@ public: , ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection &estimatedScores) const; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const - {}; - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const - {} - FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/FF/SkeletonStatefulFF.cpp b/moses/FF/SkeletonStatefulFF.cpp index 4b077335e..0af74aabd 100644 --- a/moses/FF/SkeletonStatefulFF.cpp +++ b/moses/FF/SkeletonStatefulFF.cpp @@ -15,12 +15,19 @@ SkeletonStatefulFF::SkeletonStatefulFF(const std::string &line) ReadParameters(); } + +// An empty implementation of this function is provided by StatefulFeatureFunction. +// Unless you are actually implementing this, please remove it from your +// implementation (and the declaration in the header file to reduce code clutter. void SkeletonStatefulFF::EvaluateInIsolation(const Phrase &source , const TargetPhrase &targetPhrase , ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection &estimatedScores) const {} +// An empty implementation of this function is provided by StatefulFeatureFunction. +// Unless you are actually implementing this, please remove it from your +// implementation (and the declaration in the header file to reduce code clutter. void SkeletonStatefulFF::EvaluateWithSourceContext(const InputType &input , const InputPath &inputPath , const TargetPhrase &targetPhrase @@ -29,8 +36,11 @@ void SkeletonStatefulFF::EvaluateWithSourceContext(const InputType &input , ScoreComponentCollection *estimatedScores) const {} -void SkeletonStatefulFF::EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const +// An empty implementation of this function is provided by StatefulFeatureFunction. +// Unless you are actually implementing this, please remove it from your +// implementation (and the declaration in the header file to reduce code clutter. +void SkeletonStatefulFF::EvaluateTranslationOptionListWithSourceContext +(const InputType &input, const TranslationOptionList &translationOptionList) const {} FFState* SkeletonStatefulFF::EvaluateWhenApplied( diff --git a/moses/FF/SkeletonStatefulFF.h b/moses/FF/SkeletonStatefulFF.h index bed54753c..196dcd27c 100644 --- a/moses/FF/SkeletonStatefulFF.h +++ b/moses/FF/SkeletonStatefulFF.h @@ -37,19 +37,35 @@ public: return new SkeletonState(0); } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const; + // An empty implementation of this function is provided by StatefulFeatureFunction. + // Unless you are actually implementing this, please remove this declaration here + // and the empty skeleton implementation from the corresponding .cpp + // file to reduce code clutter. + void + EvaluateInIsolation(const Phrase &source + , const TargetPhrase &targetPhrase + , ScoreComponentCollection &scoreBreakdown + , ScoreComponentCollection &estimatedScores) const; + + // An empty implementation of this function is provided by StatefulFeatureFunction. + // Unless you are actually implementing this, please remove this declaration here + // and the empty skeleton implementation from the corresponding .cpp + // file to reduce code clutter. + void + EvaluateWithSourceContext(const InputType &input + , const InputPath &inputPath + , const TargetPhrase &targetPhrase + , const StackVec *stackVec + , ScoreComponentCollection &scoreBreakdown + , ScoreComponentCollection *estimatedScores = NULL) const; - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const; + // An empty implementation of this function is provided by StatefulFeatureFunction. + // Unless you are actually implementing this, please remove this declaration here + // and the empty skeleton implementation from the corresponding .cpp + // file to reduce code clutter. + void + EvaluateTranslationOptionListWithSourceContext + ( const InputType &input , const TranslationOptionList &translationOptionList) const; FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, diff --git a/moses/FF/StatefulFeatureFunction.h b/moses/FF/StatefulFeatureFunction.h index 814818f63..3f4e6f85e 100644 --- a/moses/FF/StatefulFeatureFunction.h +++ b/moses/FF/StatefulFeatureFunction.h @@ -66,6 +66,23 @@ public: return false; } + + virtual void + EvaluateInIsolation + (Phrase const& source, TargetPhrase const& targetPhrase, + ScoreComponentCollection &scoreBreakdown, + ScoreComponentCollection &estimatedScores) const {} + + virtual void + EvaluateWithSourceContext + (InputType const&input, InputPath const& inputPath, TargetPhrase const& targetPhrase, + StackVec const* stackVec, ScoreComponentCollection &scoreBreakdown, + ScoreComponentCollection *estimatedFutureScore = NULL) const {} + + virtual void + EvaluateTranslationOptionListWithSourceContext + (const InputType &input, const TranslationOptionList &translationOptionList) const {} + }; diff --git a/moses/FF/TargetBigramFeature.h b/moses/FF/TargetBigramFeature.h index 200eca060..eacd27656 100644 --- a/moses/FF/TargetBigramFeature.h +++ b/moses/FF/TargetBigramFeature.h @@ -48,22 +48,6 @@ public: ScoreComponentCollection* ) const { throw std::logic_error("TargetBigramFeature not valid in chart decoder"); } - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } void SetParameter(const std::string& key, const std::string& value); diff --git a/moses/FF/TargetNgramFeature.h b/moses/FF/TargetNgramFeature.h index 5bc2fc953..0a4b4aa25 100644 --- a/moses/FF/TargetNgramFeature.h +++ b/moses/FF/TargetNgramFeature.h @@ -215,24 +215,6 @@ public: virtual FFState* EvaluateWhenApplied(const ChartHypothesis& cur_hypo, int featureId, ScoreComponentCollection* accumulator) const; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const { - } - void SetParameter(const std::string& key, const std::string& value); private: diff --git a/moses/FF/TreeStructureFeature.h b/moses/FF/TreeStructureFeature.h index 361e8cc6a..353328466 100644 --- a/moses/FF/TreeStructureFeature.h +++ b/moses/FF/TreeStructureFeature.h @@ -63,22 +63,6 @@ public: void SetParameter(const std::string& key, const std::string& value); - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const {}; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const {}; - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - - FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/LM/Base.cpp b/moses/LM/Base.cpp index 5fab4b547..9a05ef58e 100644 --- a/moses/LM/Base.cpp +++ b/moses/LM/Base.cpp @@ -69,10 +69,11 @@ void LanguageModel::ReportHistoryOrder(std::ostream &out,const Phrase &phrase) c // out << "ReportHistoryOrder not implemented"; } -void LanguageModel::EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const +void +LanguageModel:: +EvaluateInIsolation(Phrase const& source, TargetPhrase const& targetPhrase, + ScoreComponentCollection &scoreBreakdown, + ScoreComponentCollection &estimatedScores) const { // contains factors used by this LM float fullScore, nGramScore; diff --git a/moses/LM/Base.h b/moses/LM/Base.h index 7ea52e02e..c26c250ed 100644 --- a/moses/LM/Base.h +++ b/moses/LM/Base.h @@ -94,18 +94,6 @@ public: , ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection &estimatedScores) const; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores = NULL) const { - } - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const { - } - }; } diff --git a/moses/LM/BilingualLM.cpp b/moses/LM/BilingualLM.cpp index a52ccc1f2..b8974bb5e 100644 --- a/moses/LM/BilingualLM.cpp +++ b/moses/LM/BilingualLM.cpp @@ -188,22 +188,6 @@ size_t BilingualLM::getState(const Hypothesis& cur_hypo) const return hashCode; } -void BilingualLM::EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedScores) const {} - -void BilingualLM::EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedScores) const -{ - -} - - FFState* BilingualLM::EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/LM/BilingualLM.h b/moses/LM/BilingualLM.h index 5070c7cec..cb5075fd1 100644 --- a/moses/LM/BilingualLM.h +++ b/moses/LM/BilingualLM.h @@ -119,23 +119,6 @@ public: void Load(); - void EvaluateInIsolation( - const Phrase &source, - const TargetPhrase &targetPhrase, - ScoreComponentCollection &scoreBreakdown, - ScoreComponentCollection &estimatedScores) const; - - void EvaluateWithSourceContext( - const InputType &input, - const InputPath &inputPath, - const TargetPhrase &targetPhrase, - const StackVec *stackVec, - ScoreComponentCollection &scoreBreakdown, - ScoreComponentCollection *estimatedScores = NULL) const; - - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const {}; - FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state, diff --git a/moses/LM/RDLM.h b/moses/LM/RDLM.h index 8e169310f..963c1e8d5 100644 --- a/moses/LM/RDLM.h +++ b/moses/LM/RDLM.h @@ -196,18 +196,7 @@ public: } void SetParameter(const std::string& key, const std::string& value); - void EvaluateInIsolation(const Phrase &source - , const TargetPhrase &targetPhrase - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection &estimatedFutureScore) const {}; - void EvaluateWithSourceContext(const InputType &input - , const InputPath &inputPath - , const TargetPhrase &targetPhrase - , const StackVec *stackVec - , ScoreComponentCollection &scoreBreakdown - , ScoreComponentCollection *estimatedFutureScore = NULL) const {}; - void EvaluateTranslationOptionListWithSourceContext(const InputType &input - , const TranslationOptionList &translationOptionList) const {}; + FFState* EvaluateWhenApplied( const Hypothesis& cur_hypo, const FFState* prev_state,