2013-08-12 22:01:06 +04:00
|
|
|
#include "ChartTranslationOptions.h"
|
2013-08-13 15:12:58 +04:00
|
|
|
#include "InputType.h"
|
|
|
|
#include "InputPath.h"
|
2013-08-12 22:01:06 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
ChartTranslationOption::ChartTranslationOption(const TargetPhrase &targetPhrase)
|
|
|
|
:m_targetPhrase(targetPhrase)
|
|
|
|
,m_scoreBreakdown(targetPhrase.GetScoreBreakdown())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-08-08 19:18:24 +04:00
|
|
|
void ChartTranslationOption::EvaluateWithSourceContext(const InputType &input,
|
2015-01-14 14:07:42 +03:00
|
|
|
const InputPath &inputPath,
|
|
|
|
const StackVec &stackVec)
|
2013-08-13 15:12:58 +04:00
|
|
|
{
|
|
|
|
const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions();
|
|
|
|
|
|
|
|
for (size_t i = 0; i < ffs.size(); ++i) {
|
2013-08-16 00:14:04 +04:00
|
|
|
const FeatureFunction &ff = *ffs[i];
|
2014-07-10 02:06:54 +04:00
|
|
|
ff.EvaluateWithSourceContext(input, inputPath, m_targetPhrase, &stackVec, m_scoreBreakdown);
|
2013-08-13 15:12:58 +04:00
|
|
|
}
|
|
|
|
}
|
2013-09-22 17:09:49 +04:00
|
|
|
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream &out, const ChartTranslationOption &transOpt)
|
|
|
|
{
|
2013-09-27 12:35:24 +04:00
|
|
|
out << transOpt.m_targetPhrase << " " << transOpt.m_scoreBreakdown;
|
|
|
|
return out;
|
2013-09-22 17:09:49 +04:00
|
|
|
}
|
|
|
|
|
2013-08-12 22:01:06 +04:00
|
|
|
}
|
|
|
|
|