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:
authorMatthias Huck <huck@i6.informatik.rwth-aachen.de>2014-01-29 22:37:42 +0400
committerMatthias Huck <huck@i6.informatik.rwth-aachen.de>2014-01-29 22:37:42 +0400
commit86ee3e15a441aec72eaebdd0389fa925da2316c7 (patch)
tree6de24e964968820fb708a2e37a935c40a2a1494e /phrase-extract/InternalStructFeature.h
parentffd62e994ecb88358b5f3aa835f84d441ec58c77 (diff)
new version of the `score` tool
which is now capable of dealing with additional properties in an appropriate manner
Diffstat (limited to 'phrase-extract/InternalStructFeature.h')
-rw-r--r--phrase-extract/InternalStructFeature.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/phrase-extract/InternalStructFeature.h b/phrase-extract/InternalStructFeature.h
index bd513a715..7a6efec1d 100644
--- a/phrase-extract/InternalStructFeature.h
+++ b/phrase-extract/InternalStructFeature.h
@@ -21,22 +21,19 @@ 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;
+ 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;
+ 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;
+ /** 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;
};
@@ -47,9 +44,10 @@ public:
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(const std::string *treeFragment,
+ float count,
+ std::vector<float>& denseValues,
+ std::map<std::string,float>& sparseValues) const;
};
class InternalStructFeatureSparse : public InternalStructFeature
@@ -58,9 +56,10 @@ public:
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(const std::string *treeFragment,
+ float count,
+ std::vector<float>& denseValues,
+ std::map<std::string,float>& sparseValues) const;
};
}