diff options
author | David Madl <git@abanbytes.eu> | 2015-11-06 15:45:22 +0300 |
---|---|---|
committer | David Madl <git@abanbytes.eu> | 2015-11-17 19:15:13 +0300 |
commit | 0dd6c31f638de16bd9dd6abb3113e15b719dce2c (patch) | |
tree | 3eb760cfe1e11311dc8c7dd2ffe8491240ff8897 /moses | |
parent | 3288eb5f502957eaaf73f8cf35a158688df6ad3b (diff) |
FeatureFunction: enable construction without registering
Diffstat (limited to 'moses')
-rw-r--r-- | moses/FF/FeatureFunction.cpp | 6 | ||||
-rw-r--r-- | moses/FF/FeatureFunction.h | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/moses/FF/FeatureFunction.cpp b/moses/FF/FeatureFunction.cpp index 9b1ea473b..50e69742e 100644 --- a/moses/FF/FeatureFunction.cpp +++ b/moses/FF/FeatureFunction.cpp @@ -57,9 +57,7 @@ FeatureFunction(const std::string& line, bool registerNow) if (registerNow) Register(); } -FeatureFunction:: -FeatureFunction(size_t numScoreComponents, - const std::string& line) +FeatureFunction::FeatureFunction(size_t numScoreComponents, const std::string& line, bool registerNow) : m_tuneable(true) , m_requireSortingAfterSourceContext(false) , m_verbosity(std::numeric_limits<std::size_t>::max()) @@ -68,7 +66,7 @@ FeatureFunction(size_t numScoreComponents, { m_numTuneableComponents = m_numScoreComponents; ParseLine(line); - Register(); + if (registerNow) Register(); } void diff --git a/moses/FF/FeatureFunction.h b/moses/FF/FeatureFunction.h index 40307b871..2740a193e 100644 --- a/moses/FF/FeatureFunction.h +++ b/moses/FF/FeatureFunction.h @@ -62,8 +62,8 @@ public: static FeatureFunction &FindFeatureFunction(const std::string& name); static void Destroy(); - FeatureFunction(const std::string &line, bool initializeNow); - FeatureFunction(size_t numScoreComponents, const std::string &line); + FeatureFunction(const std::string &line, bool registerNow); + FeatureFunction(size_t numScoreComponents, const std::string &line, bool registerNow = true); virtual bool IsStateless() const = 0; virtual ~FeatureFunction(); |