Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Bertoldi <bertoldi@fbk.eu>2014-04-28 21:18:38 +0400
committerNicola Bertoldi <bertoldi@fbk.eu>2014-04-28 21:18:38 +0400
commit20381cbf8996ea46d32c470c8580a68eda4ec64e (patch)
treeb925ad630058c7f642f20af534829ccac2decaa2 /phrase-extract/InternalStructFeature.h
parent03825e3ffdd1042ba02a64981ebb2e4c731ef153 (diff)
parent6182750b7077f226f2eb96a8b5b97be72d274c74 (diff)
merged master into dynamic-models and solved conflicts
Diffstat (limited to 'phrase-extract/InternalStructFeature.h')
-rw-r--r--phrase-extract/InternalStructFeature.h40
1 files changed, 19 insertions, 21 deletions
diff --git a/phrase-extract/InternalStructFeature.h b/phrase-extract/InternalStructFeature.h
index fe6dedc15..7969dc8a8 100644
--- a/phrase-extract/InternalStructFeature.h
+++ b/phrase-extract/InternalStructFeature.h
@@ -21,24 +21,20 @@ 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() : m_type(0) {};
+ /** 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;
-
+ /** Overridden in subclass */
+ virtual void add(const std::string *treeFragment,
+ float count,
+ std::vector<float>& denseValues,
+ std::map<std::string,float>& sparseValues) const = 0;
+ int m_type;
};
class InternalStructFeatureDense : public InternalStructFeature
@@ -49,9 +45,10 @@ public:
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(const std::string *treeFragment,
+ float count,
+ std::vector<float>& denseValues,
+ std::map<std::string,float>& sparseValues) const;
};
class InternalStructFeatureSparse : public InternalStructFeature
@@ -62,9 +59,10 @@ public:
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(const std::string *treeFragment,
+ float count,
+ std::vector<float>& denseValues,
+ std::map<std::string,float>& sparseValues) const;
};
}