mosesdecoder/moses/FF/TargetWordInsertionFeature.h

62 lines
2.0 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include <boost/unordered_set.hpp>
2013-05-24 22:11:15 +04:00
#include "StatelessFeatureFunction.h"
2013-05-24 21:02:49 +04:00
#include "moses/FactorCollection.h"
#include "moses/AlignmentInfo.h"
namespace Moses
{
/** Sets the features for length of source phrase, target phrase, both.
*/
2013-05-29 21:16:15 +04:00
class TargetWordInsertionFeature : public StatelessFeatureFunction
{
private:
boost::unordered_set<std::string> m_vocab;
FactorType m_factorType;
bool m_unrestricted;
std::string m_filename;
public:
TargetWordInsertionFeature(const std::string &line);
2013-05-29 21:16:15 +04:00
bool IsUseable(const FactorMask &mask) const;
2015-12-10 06:17:36 +03:00
void Load(AllOptions::ptr const& opts);
virtual void EvaluateInIsolation(const Phrase &source
2015-01-14 14:07:42 +03:00
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
2015-11-04 18:10:45 +03:00
, ScoreComponentCollection &estimatedScores) const;
void EvaluateWithSourceContext(const InputType &input
2015-01-14 14:07:42 +03:00
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
2015-11-04 18:10:45 +03:00
, ScoreComponentCollection *estimatedScores = NULL) const {
2015-01-14 14:07:42 +03:00
}
void EvaluateWhenApplied(const Hypothesis& hypo,
2015-01-14 14:07:42 +03:00
ScoreComponentCollection* accumulator) const {
}
void EvaluateWhenApplied(const ChartHypothesis &hypo,
2015-01-14 14:07:42 +03:00
ScoreComponentCollection* accumulator) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
2015-01-14 14:07:42 +03:00
, const TranslationOptionList &translationOptionList) const {
}
void ComputeFeatures(const Phrase &source,
2013-05-29 21:16:15 +04:00
const TargetPhrase& targetPhrase,
ScoreComponentCollection* accumulator,
const AlignmentInfo &alignmentInfo) const;
void SetParameter(const std::string& key, const std::string& value);
};
}