mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
getting rid of m_distortionScoreProducer in staticdata
This commit is contained in:
parent
e0746cd525
commit
2835ea63e0
@ -61,15 +61,16 @@ public:
|
||||
bool operator()(const Hypothesis* hypoA, const Hypothesis* hypoB) const {
|
||||
CHECK(m_transOptRange != NULL);
|
||||
|
||||
const float weightDistortion = StaticData::Instance().GetWeightDistortion();
|
||||
const DistortionScoreProducer *dsp = StaticData::Instance().GetDistortionProducer();
|
||||
const float distortionScoreA = dsp->CalculateDistortionScore(
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
const float weightDistortion = staticData.GetWeightDistortion();
|
||||
|
||||
const float distortionScoreA = DistortionScoreProducer::CalculateDistortionScore(
|
||||
*hypoA,
|
||||
hypoA->GetCurrSourceWordsRange(),
|
||||
*m_transOptRange,
|
||||
hypoA->GetWordsBitmap().GetFirstGapPos()
|
||||
);
|
||||
const float distortionScoreB = dsp->CalculateDistortionScore(
|
||||
const float distortionScoreB = DistortionScoreProducer::CalculateDistortionScore(
|
||||
*hypoB,
|
||||
hypoB->GetCurrSourceWordsRange(),
|
||||
*m_transOptRange,
|
||||
|
@ -39,7 +39,7 @@ const FFState* DistortionScoreProducer::EmptyHypothesisState(const InputType &in
|
||||
}
|
||||
|
||||
float DistortionScoreProducer::CalculateDistortionScore(const Hypothesis& hypo,
|
||||
const WordsRange &prev, const WordsRange &curr, const int FirstGap) const
|
||||
const WordsRange &prev, const WordsRange &curr, const int FirstGap)
|
||||
{
|
||||
if(!StaticData::Instance().UseEarlyDistortionCost()) {
|
||||
return - (float) hypo.GetInput().ComputeDistortionDistance(prev, curr);
|
||||
|
@ -19,8 +19,8 @@ public:
|
||||
: StatefulFeatureFunction("Distortion", 1, line)
|
||||
{}
|
||||
|
||||
float CalculateDistortionScore(const Hypothesis& hypo,
|
||||
const WordsRange &prev, const WordsRange &curr, const int FirstGapPosition) const;
|
||||
static float CalculateDistortionScore(const Hypothesis& hypo,
|
||||
const WordsRange &prev, const WordsRange &curr, const int FirstGapPosition);
|
||||
|
||||
virtual const FFState* EmptyHypothesisState(const InputType &input) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user