2011-08-13 05:39:35 +04:00
|
|
|
#ifndef moses_SourceWordDeletionFeature_h
|
|
|
|
#define moses_SourceWordDeletionFeature_h
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "FeatureFunction.h"
|
|
|
|
#include "FactorCollection.h"
|
2012-04-19 22:08:06 +04:00
|
|
|
#include "AlignmentInfo.h"
|
2011-08-13 05:39:35 +04:00
|
|
|
|
|
|
|
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:
|
2013-01-02 15:31:59 +04:00
|
|
|
SourceWordDeletionFeature(const std::string &line);
|
2011-08-13 05:39:35 +04:00
|
|
|
|
|
|
|
bool Load(const std::string &filePath);
|
2012-09-19 21:00:53 +04:00
|
|
|
void Evaluate(const PhraseBasedFeatureContext& context,
|
2012-09-07 19:57:53 +04:00
|
|
|
ScoreComponentCollection* accumulator) const;
|
2011-08-13 05:39:35 +04:00
|
|
|
|
2012-09-21 14:56:01 +04:00
|
|
|
void EvaluateChart(const ChartBasedFeatureContext& context,
|
2012-04-09 23:47:51 +04:00
|
|
|
ScoreComponentCollection* accumulator) const;
|
|
|
|
|
2012-04-19 22:08:06 +04:00
|
|
|
void ComputeFeatures(const TargetPhrase& targetPhrase,
|
|
|
|
ScoreComponentCollection* accumulator,
|
2012-10-19 19:00:42 +04:00
|
|
|
const AlignmentInfo &alignmentInfo) const;
|
2012-04-09 23:47:51 +04:00
|
|
|
|
2013-05-01 20:30:35 +04:00
|
|
|
virtual StatelessFeatureType GetStatelessFeatureType() const
|
|
|
|
{ return NotCacheable; }
|
2011-08-13 05:39:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // moses_SourceWordDeletionFeature_h
|