diff options
author | Nicola Bertoldi <bertoldi@fbk.eu> | 2014-01-15 19:49:57 +0400 |
---|---|---|
committer | Nicola Bertoldi <bertoldi@fbk.eu> | 2014-01-15 19:49:57 +0400 |
commit | e452a13062400b09ff95af971c1424ac34cf1930 (patch) | |
tree | 11b52a2f1228f4e64fb31d061d7e564970140fd7 /phrase-extract/InternalStructFeature.h | |
parent | bd83999264407dd7970736ee3e70a6b39fb19014 (diff) |
beautify
Diffstat (limited to 'phrase-extract/InternalStructFeature.h')
-rw-r--r-- | phrase-extract/InternalStructFeature.h | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/phrase-extract/InternalStructFeature.h b/phrase-extract/InternalStructFeature.h index bd513a715..fe6dedc15 100644 --- a/phrase-extract/InternalStructFeature.h +++ b/phrase-extract/InternalStructFeature.h @@ -21,46 +21,50 @@ namespace MosesTraining class InternalStructFeature : public ScoreFeature { public: - InternalStructFeature(); - /** Return true if the two phrase pairs are equal from the point of this feature. Assume - that they already compare true according to PhraseAlignment.equals() - **/ - bool equals(const PhraseAlignment& lhs, const PhraseAlignment& rhs) const; - /** Add the values for this feature function. */ - void add(const ScoreFeatureContext& context, - std::vector<float>& denseValues, - std::map<std::string,float>& sparseValues) const; + InternalStructFeature(); + /** Return true if the two phrase pairs are equal from the point of this feature. Assume + that they already compare true according to PhraseAlignment.equals() + **/ + bool equals(const PhraseAlignment& lhs, const PhraseAlignment& rhs) const; + /** Add the values for this feature function. */ + void add(const ScoreFeatureContext& context, + std::vector<float>& denseValues, + std::map<std::string,float>& sparseValues) const; protected: - /** Overriden in subclass */ - virtual void add(std::string *internalStruct, - std::vector<float>& denseValues, - std::map<std::string,float>& sparseValues) const = 0; - int m_type; + /** Overriden in subclass */ + virtual void add(std::string *internalStruct, + std::vector<float>& denseValues, + std::map<std::string,float>& sparseValues) const = 0; + int m_type; }; class InternalStructFeatureDense : public InternalStructFeature { public: - InternalStructFeatureDense() - :InternalStructFeature(){m_type=1;} //std::cout<<"InternalStructFeatureDense: Construct "<<m_type<<"\n";} + InternalStructFeatureDense() + :InternalStructFeature() { + m_type=1; + } //std::cout<<"InternalStructFeatureDense: Construct "<<m_type<<"\n";} protected: - virtual void add(std::string *internalStruct, - std::vector<float>& denseValues, - std::map<std::string,float>& sparseValues) const; + virtual void add(std::string *internalStruct, + std::vector<float>& denseValues, + std::map<std::string,float>& sparseValues) const; }; class InternalStructFeatureSparse : public InternalStructFeature { public: - InternalStructFeatureSparse() - :InternalStructFeature(){m_type=2;}// std::cout<<"InternalStructFeatureSparse: Construct "<<m_type<<"\n";} + InternalStructFeatureSparse() + :InternalStructFeature() { + m_type=2; + }// std::cout<<"InternalStructFeatureSparse: Construct "<<m_type<<"\n";} protected: - virtual void add(std::string *internalStruct, - std::vector<float>& denseValues, - std::map<std::string,float>& sparseValues) const; + virtual void add(std::string *internalStruct, + std::vector<float>& denseValues, + std::map<std::string,float>& sparseValues) const; }; } |