#include <DummyScoreProducers.h>


Public Member Functions | |
| DistortionScoreProducer (ScoreIndexManager &scoreIndexManager) | |
| float | CalculateDistortionScore (const Hypothesis &hypo, const WordsRange &prev, const WordsRange &curr, const int FirstGapPosition) const |
| size_t | GetNumScoreComponents () const |
| std::string | GetScoreProducerDescription () const |
| returns a string description of this producer | |
| std::string | GetScoreProducerWeightShortName () const |
| returns the weight parameter name of this producer (used in n-best list) | |
| size_t | GetNumInputScores () const |
| returns the number of scores gathered from the input (0 by default) | |
| virtual const FFState * | EmptyHypothesisState (const InputType &input) const |
| return the state associated with the empty hypothesis for a given sentence | |
| virtual FFState * | Evaluate (const Hypothesis &cur_hypo, const FFState *prev_state, ScoreComponentCollection *accumulator) const |
| This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble. | |
| Moses::DistortionScoreProducer::DistortionScoreProducer | ( | ScoreIndexManager & | scoreIndexManager | ) |
| float Moses::DistortionScoreProducer::CalculateDistortionScore | ( | const Hypothesis & | hypo, | |
| const WordsRange & | prev, | |||
| const WordsRange & | curr, | |||
| const int | FirstGapPosition | |||
| ) | const |
References Moses::InputType::ComputeDistortionDistance(), Moses::WordsRange::GetEndPos(), Moses::Hypothesis::GetInput(), Moses::WordsRange::GetNumWordsBetween(), Moses::WordsRange::GetNumWordsCovered(), and Moses::WordsRange::GetStartPos().
Referenced by Evaluate(), and Moses::HypothesisScoreOrdererWithDistortion::operator()().


| const FFState * Moses::DistortionScoreProducer::EmptyHypothesisState | ( | const InputType & | input | ) | const [virtual] |
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
References Moses::InputType::m_frontSpanCoveredLength, and NOT_FOUND.
| FFState * Moses::DistortionScoreProducer::Evaluate | ( | const Hypothesis & | cur_hypo, | |
| const FFState * | prev_state, | |||
| ScoreComponentCollection * | accumulator | |||
| ) | const [virtual] |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.
Implements Moses::StatefulFeatureFunction.
References CalculateDistortionScore(), Moses::DistortionState_traditional::first_gap, Moses::Hypothesis::GetCurrSourceWordsRange(), Moses::WordsBitmap::GetFirstGapPos(), Moses::Hypothesis::GetPrevHypo(), Moses::Hypothesis::GetWordsBitmap(), Moses::ScoreComponentCollection::PlusEquals(), and Moses::DistortionState_traditional::range.

| size_t Moses::DistortionScoreProducer::GetNumInputScores | ( | ) | const [virtual] |
returns the number of scores gathered from the input (0 by default)
Reimplemented from Moses::ScoreProducer.
| size_t Moses::DistortionScoreProducer::GetNumScoreComponents | ( | ) | const [virtual] |
returns the number of scores that a subclass produces. For example, a language model conventionally produces 1, a translation table some arbitrary number, etc
Implements Moses::ScoreProducer.
| std::string Moses::DistortionScoreProducer::GetScoreProducerDescription | ( | ) | const [virtual] |
| std::string Moses::DistortionScoreProducer::GetScoreProducerWeightShortName | ( | ) | const [virtual] |
returns the weight parameter name of this producer (used in n-best list)
Implements Moses::ScoreProducer.
1.5.9