mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
remove description argument from feature function constructor. Redundant
This commit is contained in:
parent
bd82b7355b
commit
a5f391e3f3
@ -76,7 +76,7 @@ void BleuScoreState::AddNgramCountAndMatches(std::vector< size_t >& counts,
|
||||
|
||||
|
||||
BleuScoreFeature::BleuScoreFeature(const std::string &line)
|
||||
:StatefulFeatureFunction("BleuScoreFeature",1, line),
|
||||
:StatefulFeatureFunction(1, line),
|
||||
m_enabled(true),
|
||||
m_sentence_bleu(true),
|
||||
m_simple_history_bleu(false),
|
||||
|
@ -34,7 +34,7 @@ class ConstrainedDecoding : public StatefulFeatureFunction
|
||||
{
|
||||
public:
|
||||
ConstrainedDecoding(const std::string &line)
|
||||
:StatefulFeatureFunction("ConstrainedDecoding", 1, line)
|
||||
:StatefulFeatureFunction(1, line)
|
||||
,m_maxUnknowns(0) {
|
||||
m_tuneable = false;
|
||||
ReadParameters();
|
||||
|
@ -45,7 +45,7 @@ class ControlRecombination : public StatefulFeatureFunction
|
||||
{
|
||||
public:
|
||||
ControlRecombination(const std::string &line)
|
||||
:StatefulFeatureFunction("ControlRecombination", 0, line)
|
||||
:StatefulFeatureFunction(0, line)
|
||||
,m_type(SameOutput)
|
||||
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ struct DistortionState_traditional : public FFState {
|
||||
};
|
||||
|
||||
DistortionScoreProducer::DistortionScoreProducer(const std::string &line)
|
||||
: StatefulFeatureFunction("Distortion", 1, line)
|
||||
: StatefulFeatureFunction(1, line)
|
||||
{
|
||||
ReadParameters();
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class ExternalFeature : public StatefulFeatureFunction
|
||||
{
|
||||
public:
|
||||
ExternalFeature(const std::string &line)
|
||||
:StatefulFeatureFunction("ExternalFeature", line) {
|
||||
:StatefulFeatureFunction(line) {
|
||||
ReadParameters();
|
||||
}
|
||||
~ExternalFeature();
|
||||
|
@ -30,8 +30,7 @@ FeatureFunction &FeatureFunction::FindFeatureFunction(const std::string& name)
|
||||
}
|
||||
|
||||
FeatureFunction::
|
||||
FeatureFunction(const std::string& description,
|
||||
const std::string& line)
|
||||
FeatureFunction(const std::string& line)
|
||||
: m_tuneable(true)
|
||||
, m_numScoreComponents(1)
|
||||
{
|
||||
@ -39,8 +38,7 @@ FeatureFunction(const std::string& description,
|
||||
}
|
||||
|
||||
FeatureFunction::
|
||||
FeatureFunction(const std::string& description,
|
||||
size_t numScoreComponents,
|
||||
FeatureFunction(size_t numScoreComponents,
|
||||
const std::string& line)
|
||||
: m_tuneable(true)
|
||||
, m_numScoreComponents(numScoreComponents)
|
||||
|
@ -45,8 +45,8 @@ public:
|
||||
}
|
||||
static FeatureFunction &FindFeatureFunction(const std::string& name);
|
||||
|
||||
FeatureFunction(const std::string& description, const std::string &line);
|
||||
FeatureFunction(const std::string& description, size_t numScoreComponents, const std::string &line);
|
||||
FeatureFunction(const std::string &line);
|
||||
FeatureFunction(size_t numScoreComponents, const std::string &line);
|
||||
virtual bool IsStateless() const = 0;
|
||||
virtual ~FeatureFunction();
|
||||
|
||||
|
@ -10,7 +10,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
LexicalReordering::LexicalReordering(const std::string &line)
|
||||
: StatefulFeatureFunction("LexicalReordering", line)
|
||||
: StatefulFeatureFunction(line)
|
||||
{
|
||||
std::cerr << "Initializing LexicalReordering.." << std::endl;
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
OpSequenceModel::OpSequenceModel(const std::string &line)
|
||||
:StatefulFeatureFunction("OpSequenceModel", 5, line )
|
||||
:StatefulFeatureFunction(5, line )
|
||||
{
|
||||
sFactor = 0;
|
||||
tFactor = 0;
|
||||
|
@ -18,7 +18,7 @@ int PhraseBoundaryState::Compare(const FFState& other) const
|
||||
}
|
||||
|
||||
PhraseBoundaryFeature::PhraseBoundaryFeature(const std::string &line)
|
||||
: StatefulFeatureFunction("PhraseBoundaryFeature", 0, line)
|
||||
: StatefulFeatureFunction(0, line)
|
||||
{
|
||||
std::cerr << "Initializing source word deletion feature.." << std::endl;
|
||||
ReadParameters();
|
||||
|
@ -22,7 +22,7 @@ class SkeletonStatefulFF : public StatefulFeatureFunction
|
||||
{
|
||||
public:
|
||||
SkeletonStatefulFF(const std::string &line)
|
||||
:StatefulFeatureFunction("SkeletonStatefulFF", 3, line)
|
||||
:StatefulFeatureFunction(3, line)
|
||||
{}
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const {
|
||||
|
@ -5,14 +5,14 @@ namespace Moses
|
||||
|
||||
std::vector<const StatefulFeatureFunction*> StatefulFeatureFunction::m_statefulFFs;
|
||||
|
||||
StatefulFeatureFunction::StatefulFeatureFunction(const std::string& description, const std::string &line)
|
||||
: FeatureFunction(description, line)
|
||||
StatefulFeatureFunction::StatefulFeatureFunction(const std::string &line)
|
||||
: FeatureFunction(line)
|
||||
{
|
||||
m_statefulFFs.push_back(this);
|
||||
}
|
||||
|
||||
StatefulFeatureFunction::StatefulFeatureFunction(const std::string& description, size_t numScoreComponents, const std::string &line)
|
||||
: FeatureFunction(description,numScoreComponents, line)
|
||||
StatefulFeatureFunction::StatefulFeatureFunction(size_t numScoreComponents, const std::string &line)
|
||||
: FeatureFunction(numScoreComponents, line)
|
||||
{
|
||||
m_statefulFFs.push_back(this);
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ public:
|
||||
return m_statefulFFs;
|
||||
}
|
||||
|
||||
StatefulFeatureFunction(const std::string& description, const std::string &line);
|
||||
StatefulFeatureFunction(const std::string& description, size_t numScoreComponents, const std::string &line);
|
||||
StatefulFeatureFunction(const std::string &line);
|
||||
StatefulFeatureFunction(size_t numScoreComponents, const std::string &line);
|
||||
|
||||
/**
|
||||
* \brief This interface should be implemented.
|
||||
|
@ -6,13 +6,13 @@ namespace Moses
|
||||
std::vector<const StatelessFeatureFunction*> StatelessFeatureFunction::m_statelessFFs;
|
||||
|
||||
StatelessFeatureFunction::StatelessFeatureFunction(const std::string &line)
|
||||
:FeatureFunction("", line)
|
||||
:FeatureFunction(line)
|
||||
{
|
||||
m_statelessFFs.push_back(this);
|
||||
}
|
||||
|
||||
StatelessFeatureFunction::StatelessFeatureFunction(size_t numScoreComponents, const std::string &line)
|
||||
:FeatureFunction("", numScoreComponents, line)
|
||||
:FeatureFunction(numScoreComponents, line)
|
||||
{
|
||||
m_statelessFFs.push_back(this);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ int TargetBigramState::Compare(const FFState& other) const
|
||||
}
|
||||
|
||||
TargetBigramFeature::TargetBigramFeature(const std::string &line)
|
||||
:StatefulFeatureFunction("TargetBigramFeature", 0, line)
|
||||
:StatefulFeatureFunction(0, line)
|
||||
{
|
||||
std::cerr << "Initializing target bigram feature.." << std::endl;
|
||||
ReadParameters();
|
||||
|
@ -38,7 +38,7 @@ int TargetNgramState::Compare(const FFState& other) const
|
||||
}
|
||||
|
||||
TargetNgramFeature::TargetNgramFeature(const std::string &line)
|
||||
:StatefulFeatureFunction("TargetNgramFeature", 0, line)
|
||||
:StatefulFeatureFunction(0, line)
|
||||
{
|
||||
std::cerr << "Initializing target ngram feature.." << std::endl;
|
||||
ReadParameters();
|
||||
|
@ -34,8 +34,8 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
LanguageModel::LanguageModel(const std::string& description, const std::string &line) :
|
||||
StatefulFeatureFunction(description, StaticData::Instance().GetLMEnableOOVFeature() ? 2 : 1, line )
|
||||
LanguageModel::LanguageModel(const std::string &line) :
|
||||
StatefulFeatureFunction(StaticData::Instance().GetLMEnableOOVFeature() ? 2 : 1, line )
|
||||
{
|
||||
m_enableOOVFeature = StaticData::Instance().GetLMEnableOOVFeature();
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class Phrase;
|
||||
class LanguageModel : public StatefulFeatureFunction
|
||||
{
|
||||
protected:
|
||||
LanguageModel(const std::string& description, const std::string &line);
|
||||
LanguageModel(const std::string &line);
|
||||
|
||||
// This can't be in the constructor for virual function dispatch reasons
|
||||
|
||||
|
@ -40,7 +40,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
LanguageModelIRST::LanguageModelIRST(const std::string &line)
|
||||
:LanguageModelSingleFactor("IRSTLM", line)
|
||||
:LanguageModelSingleFactor(line)
|
||||
{
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
int threadCount = staticData.ThreadCount();
|
||||
|
@ -41,8 +41,8 @@ using namespace std;
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
LanguageModelImplementation::LanguageModelImplementation(const std::string& description, const std::string &line)
|
||||
:LanguageModel(description, line)
|
||||
LanguageModelImplementation::LanguageModelImplementation(const std::string &line)
|
||||
:LanguageModel(line)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ protected:
|
||||
Word m_sentenceStartWord, m_sentenceEndWord; //! Contains factors which represents the beging and end words for this LM.
|
||||
//! Usually <s> and </s>
|
||||
|
||||
LanguageModelImplementation(const std::string& description, const std::string &line);
|
||||
LanguageModelImplementation(const std::string &line);
|
||||
|
||||
public:
|
||||
|
||||
|
@ -50,7 +50,7 @@ protected:
|
||||
size_t m_implFactor;
|
||||
public:
|
||||
LanguageModelJoint(const std::string &line, LanguageModelSingleFactor *lmImpl)
|
||||
:LanguageModelMultiFactor("JointLM", line) {
|
||||
:LanguageModelMultiFactor(line) {
|
||||
m_lmImpl = lmImpl;
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ private:
|
||||
} // namespace
|
||||
|
||||
template <class Model> LanguageModelKen<Model>::LanguageModelKen(const std::string &line, const std::string &file, FactorType factorType, bool lazy)
|
||||
:LanguageModel("KENLM", line)
|
||||
:LanguageModel(line)
|
||||
,m_factorType(factorType)
|
||||
{
|
||||
lm::ngram::Config config;
|
||||
@ -161,7 +161,7 @@ template <class Model> LanguageModelKen<Model>::LanguageModelKen(const std::stri
|
||||
}
|
||||
|
||||
template <class Model> LanguageModelKen<Model>::LanguageModelKen(const LanguageModelKen<Model> ©_from)
|
||||
:LanguageModel(copy_from.GetScoreProducerDescription(), copy_from.GetArgLine()),
|
||||
:LanguageModel(copy_from.GetArgLine()),
|
||||
m_ngram(copy_from.m_ngram),
|
||||
// TODO: don't copy this.
|
||||
m_lmIdLookup(copy_from.m_lmIdLookup),
|
||||
|
@ -41,8 +41,8 @@ class LanguageModelMultiFactor : public LanguageModelImplementation
|
||||
protected:
|
||||
FactorMask m_factorTypes;
|
||||
|
||||
LanguageModelMultiFactor(const std::string& description, const std::string &line)
|
||||
:LanguageModelImplementation(description, line) {
|
||||
LanguageModelMultiFactor(const std::string &line)
|
||||
:LanguageModelImplementation(line) {
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -10,7 +10,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
NeuralLMWrapper::NeuralLMWrapper(const std::string &line)
|
||||
:LanguageModelSingleFactor("NeuralLM", line)
|
||||
:LanguageModelSingleFactor(line)
|
||||
{
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class LanguageModelORLM : public LanguageModelSingleFactor
|
||||
public:
|
||||
typedef count_t T; // type for ORLM filter
|
||||
LanguageModelORLM(const std::string &line)
|
||||
:LanguageModelSingleFactor("ORLM", line)
|
||||
:LanguageModelSingleFactor(line)
|
||||
,m_lm(0) {
|
||||
}
|
||||
bool Load(const std::string &filePath, FactorType factorType, size_t nGramOrder);
|
||||
|
@ -85,7 +85,7 @@ private:
|
||||
|
||||
public:
|
||||
LanguageModelParallelBackoff(const std::string &line)
|
||||
:LanguageModelMultiFactor("ParallelBackoffLM", line) {
|
||||
:LanguageModelMultiFactor(line) {
|
||||
}
|
||||
|
||||
~LanguageModelParallelBackoff();
|
||||
|
@ -44,7 +44,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
LanguageModelRandLM::LanguageModelRandLM(const std::string &line)
|
||||
:LanguageModelSingleFactor("RandLM", line)
|
||||
:LanguageModelSingleFactor(line)
|
||||
, m_lm(0)
|
||||
{
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
LanguageModelSRI::LanguageModelSRI(const std::string &line)
|
||||
:LanguageModelSingleFactor("SRILM", line)
|
||||
:LanguageModelSingleFactor(line)
|
||||
,m_srilmVocab(0)
|
||||
,m_srilmModel(0)
|
||||
{
|
||||
|
@ -38,8 +38,8 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
LanguageModelSingleFactor::LanguageModelSingleFactor(const std::string& description, const std::string &line)
|
||||
:LanguageModelImplementation(description, line)
|
||||
LanguageModelSingleFactor::LanguageModelSingleFactor(const std::string &line)
|
||||
:LanguageModelImplementation(line)
|
||||
{
|
||||
m_nullContextState = new PointerState(NULL);
|
||||
m_beginSentenceState = new PointerState(NULL);
|
||||
|
@ -43,7 +43,7 @@ protected:
|
||||
FFState *m_nullContextState;
|
||||
FFState *m_beginSentenceState;
|
||||
|
||||
LanguageModelSingleFactor(const std::string& description, const std::string &line);
|
||||
LanguageModelSingleFactor(const std::string &line);
|
||||
|
||||
public:
|
||||
virtual ~LanguageModelSingleFactor();
|
||||
|
@ -7,7 +7,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
SkeletonLM::SkeletonLM(const std::string &line)
|
||||
:LanguageModelSingleFactor("SkeletonLM", line)
|
||||
:LanguageModelSingleFactor(line)
|
||||
{
|
||||
ReadParameters();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user