2008-06-11 14:52:57 +04:00
|
|
|
// $Id$
|
|
|
|
|
2010-02-24 14:15:44 +03:00
|
|
|
#ifndef moses_DummyScoreProducers_h
|
|
|
|
#define moses_DummyScoreProducers_h
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2009-02-06 18:43:06 +03:00
|
|
|
#include "FeatureFunction.h"
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2008-10-09 03:51:26 +04:00
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
class WordsRange;
|
|
|
|
|
|
|
|
/** Calculates Distortion scores
|
|
|
|
*/
|
2011-02-24 16:14:42 +03:00
|
|
|
class DistortionScoreProducer : public StatefulFeatureFunction
|
|
|
|
{
|
2008-06-11 14:52:57 +04:00
|
|
|
public:
|
2011-02-24 16:14:42 +03:00
|
|
|
DistortionScoreProducer(ScoreIndexManager &scoreIndexManager);
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
float CalculateDistortionScore(const Hypothesis& hypo,
|
2009-08-07 20:47:54 +04:00
|
|
|
const WordsRange &prev, const WordsRange &curr, const int FirstGapPosition) const;
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
size_t GetNumScoreComponents() const;
|
|
|
|
std::string GetScoreProducerDescription() const;
|
|
|
|
std::string GetScoreProducerWeightShortName() const;
|
|
|
|
size_t GetNumInputScores() const;
|
2009-02-06 18:43:06 +03:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
virtual const FFState* EmptyHypothesisState(const InputType &input) const;
|
2009-02-06 18:43:06 +03:00
|
|
|
|
|
|
|
virtual FFState* Evaluate(
|
|
|
|
const Hypothesis& cur_hypo,
|
|
|
|
const FFState* prev_state,
|
|
|
|
ScoreComponentCollection* accumulator) const;
|
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Doesn't do anything but provide a key into the global
|
|
|
|
* score array to store the word penalty in.
|
|
|
|
*/
|
2011-02-24 16:14:42 +03:00
|
|
|
class WordPenaltyProducer : public StatelessFeatureFunction
|
|
|
|
{
|
2008-06-11 14:52:57 +04:00
|
|
|
public:
|
2011-02-24 16:14:42 +03:00
|
|
|
WordPenaltyProducer(ScoreIndexManager &scoreIndexManager);
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
size_t GetNumScoreComponents() const;
|
|
|
|
std::string GetScoreProducerDescription() const;
|
|
|
|
std::string GetScoreProducerWeightShortName() const;
|
|
|
|
size_t GetNumInputScores() const;
|
2009-02-06 18:43:06 +03:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
virtual void Evaluate(
|
|
|
|
const TargetPhrase& phrase,
|
|
|
|
ScoreComponentCollection* out) const;
|
2009-02-06 18:43:06 +03:00
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/** unknown word penalty */
|
2011-02-24 16:14:42 +03:00
|
|
|
class UnknownWordPenaltyProducer : public StatelessFeatureFunction
|
|
|
|
{
|
2008-06-11 14:52:57 +04:00
|
|
|
public:
|
2011-02-24 16:14:42 +03:00
|
|
|
UnknownWordPenaltyProducer(ScoreIndexManager &scoreIndexManager);
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
size_t GetNumScoreComponents() const;
|
|
|
|
std::string GetScoreProducerDescription() const;
|
|
|
|
std::string GetScoreProducerWeightShortName() const;
|
|
|
|
size_t GetNumInputScores() const;
|
2009-02-06 18:43:06 +03:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
virtual bool ComputeValueInTranslationOption() const;
|
2009-02-06 18:43:06 +03:00
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
};
|
|
|
|
|
2008-10-09 03:51:26 +04:00
|
|
|
}
|
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
#endif
|