Moses::DistortionScoreProducer Class Reference

#include <DummyScoreProducers.h>

Inheritance diagram for Moses::DistortionScoreProducer:

Inheritance graph
[legend]
Collaboration diagram for Moses::DistortionScoreProducer:

Collaboration graph
[legend]

List of all members.

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 FFStateEmptyHypothesisState (const InputType &input) const
 return the state associated with the empty hypothesis for a given sentence
virtual FFStateEvaluate (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.


Detailed Description

Calculates Distortion scores

Constructor & Destructor Documentation

Moses::DistortionScoreProducer::DistortionScoreProducer ( ScoreIndexManager scoreIndexManager  ) 

References Moses::ScoreIndexManager::AddScoreProducer().

Here is the call graph for this function:


Member Function Documentation

float Moses::DistortionScoreProducer::CalculateDistortionScore ( const Hypothesis hypo,
const WordsRange prev,
const WordsRange curr,
const int  FirstGapPosition 
) const

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.

Here is the call graph for this function:

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]

returns a string description of this producer

Implements Moses::ScoreProducer.

std::string Moses::DistortionScoreProducer::GetScoreProducerWeightShortName (  )  const [virtual]

returns the weight parameter name of this producer (used in n-best list)

Implements Moses::ScoreProducer.


The documentation for this class was generated from the following files:

Generated on Fri Jul 30 20:05:16 2010 for Moses by  doxygen 1.5.9