mosesdecoder/moses/FF/NieceTerminal.h

55 lines
1.7 KiB
C
Raw Normal View History

2014-05-20 22:51:46 +04:00
#pragma once
#include <boost/unordered_set.hpp>
2014-05-20 22:51:46 +04:00
#include <string>
#include "StatelessFeatureFunction.h"
namespace Moses
{
2015-10-25 16:37:59 +03:00
class Range;
2014-05-20 22:51:46 +04:00
class Word;
// 1 of the non-term covers the same word as 1 of the terminals
2014-05-20 23:02:49 +04:00
class NieceTerminal : public StatelessFeatureFunction
2014-05-20 22:51:46 +04:00
{
public:
2014-05-29 01:51:26 +04:00
NieceTerminal(const std::string &line);
2014-05-20 22:51:46 +04:00
bool IsUseable(const FactorMask &mask) const {
return true;
}
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 EvaluateTranslationOptionListWithSourceContext(const InputType &input
2015-01-14 14:07:42 +03:00
, const TranslationOptionList &translationOptionList) const {
}
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;
2014-05-20 22:51:46 +04:00
2014-05-29 01:51:26 +04:00
void SetParameter(const std::string& key, const std::string& value);
std::vector<float> DefaultWeights() const;
2014-05-29 01:51:26 +04:00
2014-05-20 22:51:46 +04:00
protected:
2014-05-29 01:51:26 +04:00
bool m_hardConstraint;
2014-05-21 16:43:32 +04:00
bool ContainTerm(const InputType &input,
2015-10-25 16:37:59 +03:00
const Range &ntRange,
const boost::unordered_set<Word> &terms) const;
2014-05-20 22:51:46 +04:00
};
}
2014-05-29 01:51:26 +04:00