mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
41 lines
1021 B
C++
41 lines
1021 B
C++
#ifndef moses_SourceWordDeletionFeature_h
|
|
#define moses_SourceWordDeletionFeature_h
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
#include "FeatureFunction.h"
|
|
#include "FactorCollection.h"
|
|
#include "AlignmentInfo.h"
|
|
|
|
namespace Moses
|
|
{
|
|
|
|
/** Sets the features for source word deletion
|
|
*/
|
|
class SourceWordDeletionFeature : public StatelessFeatureFunction {
|
|
private:
|
|
std::set<std::string> m_vocab;
|
|
FactorType m_factorType;
|
|
bool m_unrestricted;
|
|
|
|
public:
|
|
SourceWordDeletionFeature(const std::string &line);
|
|
|
|
bool Load(const std::string &filePath);
|
|
void Evaluate(const PhraseBasedFeatureContext& context,
|
|
ScoreComponentCollection* accumulator) const;
|
|
|
|
void EvaluateChart(const ChartBasedFeatureContext& context,
|
|
ScoreComponentCollection* accumulator) const;
|
|
|
|
void ComputeFeatures(const TargetPhrase& targetPhrase,
|
|
ScoreComponentCollection* accumulator,
|
|
const AlignmentInfo &alignmentInfo) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // moses_SourceWordDeletionFeature_h
|