Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ChartTranslationOption.cpp « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 65cb2afbd00016e3406f84d09f79572f6ab8bde7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "ChartTranslationOptions.h"
#include "InputType.h"
#include "InputPath.h"

namespace Moses
{
ChartTranslationOption::ChartTranslationOption(const TargetPhrase &targetPhrase)
  :m_targetPhrase(targetPhrase)
  ,m_scoreBreakdown(targetPhrase.GetScoreBreakdown())
{
}

void ChartTranslationOption::EvaluateWithSourceContext(const InputType &input,
    const InputPath &inputPath,
    const StackVec &stackVec)
{
  const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions();

  for (size_t i = 0; i < ffs.size(); ++i) {
    const FeatureFunction &ff = *ffs[i];
    ff.EvaluateWithSourceContext(input, inputPath, m_targetPhrase, &stackVec, m_scoreBreakdown);
  }
}


std::ostream& operator<<(std::ostream &out, const ChartTranslationOption &transOpt)
{
  out << transOpt.m_targetPhrase << " " << transOpt.m_scoreBreakdown;
  return out;
}

}