mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
40 lines
1006 B
C++
40 lines
1006 B
C++
#ifndef moses_TargetWordInsertionFeature_h
|
|
#define moses_TargetWordInsertionFeature_h
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
#include "FeatureFunction.h"
|
|
#include "FactorCollection.h"
|
|
#include "AlignmentInfo.h"
|
|
|
|
namespace Moses
|
|
{
|
|
|
|
/** Sets the features for length of source phrase, target phrase, both.
|
|
*/
|
|
class TargetWordInsertionFeature : public StatelessFeatureFunction {
|
|
private:
|
|
std::set<std::string> m_vocab;
|
|
FactorType m_factorType;
|
|
bool m_unrestricted;
|
|
|
|
public:
|
|
TargetWordInsertionFeature(const std::string &line);
|
|
|
|
bool Load(const std::string &filePath);
|
|
|
|
virtual void Evaluate(const TargetPhrase &targetPhrase
|
|
, ScoreComponentCollection &scoreBreakdown
|
|
, ScoreComponentCollection &estimatedFutureScore) const;
|
|
|
|
void ComputeFeatures(const TargetPhrase& targetPhrase,
|
|
ScoreComponentCollection* accumulator,
|
|
const AlignmentInfo &alignmentInfo) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // moses_TargetWordInsertionFeature_h
|