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
ab8402cfe8
commit
bd82b7355b
@ -1156,6 +1156,16 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/FF/InputFeature.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>FF/InternalStructStatelessFF.cpp</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/FF/InternalStructStatelessFF.cpp</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>FF/InternalStructStatelessFF.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/moses/FF/InternalStructStatelessFF.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>FF/LexicalReordering</name>
|
||||
<type>2</type>
|
||||
|
@ -29,27 +29,24 @@ using namespace std;
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
DecodeFeature::DecodeFeature( const std::string& description
|
||||
, const std::string &line)
|
||||
: StatelessFeatureFunction(description, line)
|
||||
DecodeFeature::DecodeFeature(const std::string &line)
|
||||
: StatelessFeatureFunction(line)
|
||||
{
|
||||
VERBOSE(2,"DecodeFeature:" << std::endl);
|
||||
}
|
||||
|
||||
DecodeFeature::DecodeFeature( const std::string& description
|
||||
, size_t numScoreComponents
|
||||
DecodeFeature::DecodeFeature(size_t numScoreComponents
|
||||
, const std::string &line)
|
||||
: StatelessFeatureFunction(description,numScoreComponents, line)
|
||||
: StatelessFeatureFunction(numScoreComponents, line)
|
||||
{
|
||||
VERBOSE(2,"DecodeFeature: no factors yet" << std::endl);
|
||||
}
|
||||
|
||||
DecodeFeature::DecodeFeature(const std::string& description
|
||||
, size_t numScoreComponents
|
||||
DecodeFeature::DecodeFeature(size_t numScoreComponents
|
||||
, const std::vector<FactorType> &input
|
||||
, const std::vector<FactorType> &output
|
||||
, const std::string &line)
|
||||
: StatelessFeatureFunction(description,numScoreComponents, line)
|
||||
: StatelessFeatureFunction(numScoreComponents, line)
|
||||
, m_input(input), m_output(output)
|
||||
{
|
||||
m_inputFactors = FactorMask(input);
|
||||
|
@ -38,15 +38,12 @@ class DecodeFeature : public StatelessFeatureFunction
|
||||
{
|
||||
|
||||
public:
|
||||
DecodeFeature( const std::string& description
|
||||
DecodeFeature(const std::string &line);
|
||||
|
||||
DecodeFeature(size_t numScoreComponents
|
||||
, const std::string &line);
|
||||
|
||||
DecodeFeature( const std::string& description
|
||||
, size_t numScoreComponents
|
||||
, const std::string &line);
|
||||
|
||||
DecodeFeature( const std::string& description
|
||||
, size_t numScoreComponents
|
||||
DecodeFeature(size_t numScoreComponents
|
||||
, const std::vector<FactorType> &input
|
||||
, const std::vector<FactorType> &output
|
||||
, const std::string &line);
|
||||
|
@ -11,7 +11,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
GlobalLexicalModel::GlobalLexicalModel(const std::string &line)
|
||||
: StatelessFeatureFunction("GlobalLexicalModel",1, line)
|
||||
: StatelessFeatureFunction(1, line)
|
||||
{
|
||||
std::cerr << "Creating global lexical model...\n";
|
||||
ReadParameters();
|
||||
|
@ -11,7 +11,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
GlobalLexicalModelUnlimited::GlobalLexicalModelUnlimited(const std::string &line)
|
||||
:StatelessFeatureFunction("GlobalLexicalModelUnlimited", 0, line)
|
||||
:StatelessFeatureFunction(0, line)
|
||||
{
|
||||
CHECK(false); // TODO need to update arguments to key=value
|
||||
|
||||
|
@ -12,7 +12,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
InputFeature::InputFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("InputFeature", line)
|
||||
:StatelessFeatureFunction(line)
|
||||
{
|
||||
ReadParameters();
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class InternalStructStatelessFF : public StatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
InternalStructStatelessFF(const std::string &line)
|
||||
:StatelessFeatureFunction("InternalStructStatelessFF", line)
|
||||
:StatelessFeatureFunction(line)
|
||||
{}
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const
|
||||
|
@ -10,7 +10,7 @@ namespace Moses
|
||||
using namespace std;
|
||||
|
||||
PhraseLengthFeature::PhraseLengthFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("PhraseLengthFeature", 0, line)
|
||||
:StatelessFeatureFunction(0, line)
|
||||
{
|
||||
ReadParameters();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
PhrasePairFeature::PhrasePairFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("PhrasePairFeature", 0, line)
|
||||
:StatelessFeatureFunction(0, line)
|
||||
{
|
||||
std::cerr << "Initializing PhrasePairFeature.." << std::endl;
|
||||
ReadParameters();
|
||||
|
@ -5,7 +5,7 @@
|
||||
namespace Moses
|
||||
{
|
||||
PhrasePenalty::PhrasePenalty(const std::string &line)
|
||||
: StatelessFeatureFunction("PhrasePenalty",1, line)
|
||||
: StatelessFeatureFunction(1, line)
|
||||
{
|
||||
ReadParameters();
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class SkeletonStatelessFF : public StatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
SkeletonStatelessFF(const std::string &line)
|
||||
:StatelessFeatureFunction("SkeletonStatelessFF", 2, line)
|
||||
:StatelessFeatureFunction(2, line)
|
||||
{}
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const {
|
||||
|
@ -18,7 +18,7 @@ namespace Moses
|
||||
using namespace std;
|
||||
|
||||
SourceWordDeletionFeature::SourceWordDeletionFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("SourceWordDeletionFeature", 0, line),
|
||||
:StatelessFeatureFunction(0, line),
|
||||
m_unrestricted(true)
|
||||
{
|
||||
std::cerr << "Initializing source word deletion feature.." << std::endl;
|
||||
|
@ -5,14 +5,14 @@ namespace Moses
|
||||
|
||||
std::vector<const StatelessFeatureFunction*> StatelessFeatureFunction::m_statelessFFs;
|
||||
|
||||
StatelessFeatureFunction::StatelessFeatureFunction(const std::string& description, const std::string &line)
|
||||
:FeatureFunction(description, line)
|
||||
StatelessFeatureFunction::StatelessFeatureFunction(const std::string &line)
|
||||
:FeatureFunction("", line)
|
||||
{
|
||||
m_statelessFFs.push_back(this);
|
||||
}
|
||||
|
||||
StatelessFeatureFunction::StatelessFeatureFunction(const std::string& description, size_t numScoreComponents, const std::string &line)
|
||||
:FeatureFunction(description, numScoreComponents, line)
|
||||
StatelessFeatureFunction::StatelessFeatureFunction(size_t numScoreComponents, const std::string &line)
|
||||
:FeatureFunction("", numScoreComponents, line)
|
||||
{
|
||||
m_statelessFFs.push_back(this);
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ public:
|
||||
return m_statelessFFs;
|
||||
}
|
||||
|
||||
StatelessFeatureFunction(const std::string& description, const std::string &line);
|
||||
StatelessFeatureFunction(const std::string& description, size_t numScoreComponents, const std::string &line);
|
||||
StatelessFeatureFunction(const std::string &line);
|
||||
StatelessFeatureFunction(size_t numScoreComponents, const std::string &line);
|
||||
/**
|
||||
* This should be implemented for features that apply to phrase-based models.
|
||||
**/
|
||||
|
@ -16,7 +16,7 @@ namespace Moses
|
||||
using namespace std;
|
||||
|
||||
TargetWordInsertionFeature::TargetWordInsertionFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("TargetWordInsertionFeature", 0, line),
|
||||
:StatelessFeatureFunction(0, line),
|
||||
m_unrestricted(true)
|
||||
{
|
||||
std::cerr << "Initializing target word insertion feature.." << std::endl;
|
||||
|
@ -7,7 +7,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
UnknownWordPenaltyProducer::UnknownWordPenaltyProducer(const std::string &line)
|
||||
: StatelessFeatureFunction("UnknownWordPenalty",1, line)
|
||||
: StatelessFeatureFunction(1, line)
|
||||
{
|
||||
m_tuneable = false;
|
||||
ReadParameters();
|
||||
|
@ -7,7 +7,7 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
WordPenaltyProducer::WordPenaltyProducer(const std::string &line)
|
||||
: StatelessFeatureFunction("WordPenalty",1, line)
|
||||
: StatelessFeatureFunction(1, line)
|
||||
{
|
||||
ReadParameters();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
WordTranslationFeature::WordTranslationFeature(const std::string &line)
|
||||
:StatelessFeatureFunction("WordTranslationFeature", 0, line)
|
||||
:StatelessFeatureFunction(0, line)
|
||||
,m_unrestricted(true)
|
||||
,m_simple(true)
|
||||
,m_sourceContext(false)
|
||||
|
@ -36,7 +36,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
GenerationDictionary::GenerationDictionary(const std::string &line)
|
||||
: DecodeFeature("Generation", line)
|
||||
: DecodeFeature(line)
|
||||
{
|
||||
ReadParameters();
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ BOOST_AUTO_TEST_SUITE(scc)
|
||||
class MockStatelessFeatureFunction : public StatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
MockStatelessFeatureFunction(const string& desc, size_t n, const string &line) :
|
||||
StatelessFeatureFunction(desc,n, line) {}
|
||||
MockStatelessFeatureFunction(size_t n, const string &line) :
|
||||
StatelessFeatureFunction(n, line) {}
|
||||
void Evaluate(const Hypothesis&, ScoreComponentCollection*) const {}
|
||||
void EvaluateChart(const ChartHypothesis&, ScoreComponentCollection*) const {}
|
||||
void Evaluate(const InputType &input
|
||||
@ -52,7 +52,7 @@ public:
|
||||
class MockSingleFeature : public MockStatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
MockSingleFeature(): MockStatelessFeatureFunction("MockSingle",1, "MockSingle") {}
|
||||
MockSingleFeature(): MockStatelessFeatureFunction(1, "MockSingle") {}
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const {
|
||||
return true;
|
||||
@ -62,7 +62,7 @@ public:
|
||||
class MockMultiFeature : public MockStatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
MockMultiFeature(): MockStatelessFeatureFunction("MockMulti", 5, "MockMulti") {}
|
||||
MockMultiFeature(): MockStatelessFeatureFunction(5, "MockMulti") {}
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const {
|
||||
return true;
|
||||
@ -73,7 +73,7 @@ public:
|
||||
class MockSparseFeature : public MockStatelessFeatureFunction
|
||||
{
|
||||
public:
|
||||
MockSparseFeature(): MockStatelessFeatureFunction("MockSparse", 0, "MockSparse") {}
|
||||
MockSparseFeature(): MockStatelessFeatureFunction(0, "MockSparse") {}
|
||||
|
||||
bool IsUseable(const FactorMask &mask) const {
|
||||
return true;
|
||||
|
@ -33,7 +33,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
PhraseDictionary::PhraseDictionary(const std::string &line)
|
||||
:DecodeFeature("kjkljlk", line)
|
||||
:DecodeFeature(line)
|
||||
,m_tableLimit(20) // default
|
||||
,m_maxCacheSize(DEFAULT_MAX_TRANS_OPT_CACHE_SIZE)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user