diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-11-24 22:22:37 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-11-24 22:22:37 +0300 |
commit | c8b859de678b3b1b258bbe5842e47cb96d5aaca2 (patch) | |
tree | de4cb09b0b8e040ebef8cc44aab5d9394547907b /moses/FF | |
parent | bcb0212b5b7a9535eb859f228bcfdf833aa57462 (diff) | |
parent | 5fea1ad548988d721a8850551b25f76f5dcf5694 (diff) |
Merge remote-tracking branch 'legacy/master'
Conflicts:
moses/server/TranslationRequest.cpp
Diffstat (limited to 'moses/FF')
-rw-r--r-- | moses/FF/BleuScoreFeature.h | 16 | ||||
-rw-r--r-- | moses/FF/ConstrainedDecoding.h | 18 | ||||
-rw-r--r-- | moses/FF/ControlRecombination.h | 17 | ||||
-rw-r--r-- | moses/FF/CoveredReferenceFeature.cpp | 5 | ||||
-rw-r--r-- | moses/FF/CoveredReferenceFeature.h | 8 | ||||
-rw-r--r-- | moses/FF/DistortionScoreProducer.h | 17 | ||||
-rw-r--r-- | moses/FF/LexicalReordering/LexicalReordering.h | 22 | ||||
-rw-r--r-- | moses/FF/OSM-Feature/OpSequenceModel.h | 12 | ||||
-rw-r--r-- | moses/FF/PhraseBoundaryFeature.h | 17 | ||||
-rw-r--r-- | moses/FF/PhraseOrientationFeature.h | 12 | ||||
-rw-r--r-- | moses/FF/SkeletonStatefulFF.cpp | 14 | ||||
-rw-r--r-- | moses/FF/SkeletonStatefulFF.h | 42 | ||||
-rw-r--r-- | moses/FF/StatefulFeatureFunction.h | 17 | ||||
-rw-r--r-- | moses/FF/TargetBigramFeature.h | 16 | ||||
-rw-r--r-- | moses/FF/TargetNgramFeature.h | 18 | ||||
-rw-r--r-- | moses/FF/TreeStructureFeature.h | 16 |
16 files changed, 58 insertions, 209 deletions
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..2acaf2d2e 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..7544ddd30 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; - - 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 + 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; + + // 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 ac6888aa7..5c8c2bbd6 100644 --- a/moses/FF/StatefulFeatureFunction.h +++ b/moses/FF/StatefulFeatureFunction.h @@ -70,6 +70,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, |