diff options
author | Matthias Huck <huck@i6.informatik.rwth-aachen.de> | 2013-09-13 19:13:20 +0400 |
---|---|---|
committer | Matthias Huck <huck@i6.informatik.rwth-aachen.de> | 2013-09-13 19:13:20 +0400 |
commit | 643fa188054bf05b370d56dad3e2c17a474f3f2f (patch) | |
tree | a48889960f12db390073cc95f07891234c184b04 /phrase-extract/InternalStructFeature.cpp | |
parent | c39bed60c054ba5cc36a0032714b00978b713494 (diff) | |
parent | fad57a60a7dddbdcbc05fc9f6e31683036ea0e27 (diff) |
Merge branch 'GHKMStruct' of github.com:moses-smt/mosesdecoder into GHKMStruct
Diffstat (limited to 'phrase-extract/InternalStructFeature.cpp')
-rw-r--r-- | phrase-extract/InternalStructFeature.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/phrase-extract/InternalStructFeature.cpp b/phrase-extract/InternalStructFeature.cpp index 67cc186db..e0e9fd3e2 100644 --- a/phrase-extract/InternalStructFeature.cpp +++ b/phrase-extract/InternalStructFeature.cpp @@ -11,7 +11,7 @@ InternalStructFeature::InternalStructFeature() } bool InternalStructFeature::equals(const PhraseAlignment& lhs, const PhraseAlignment& rhs) const{ - cout<<"InternalStructFeature: Equals\n"; + //cout<<"InternalStructFeature: Equals\n"; //don't know what it's used for and what we should compare //-> if the dense score is the same //-> if the sparse feature is set @@ -19,7 +19,13 @@ bool InternalStructFeature::equals(const PhraseAlignment& lhs, const PhraseAlign /** 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() **/ - return true; + +/* if(lhs.ghkmParse==rhs.ghkmParse) + return true; + else + return false; +*/ + //return true; } void InternalStructFeature::add(const ScoreFeatureContext& context, @@ -52,9 +58,15 @@ void InternalStructFeatureSparse::add(std::string *internalStruct, std::map<std::string,float>& sparseValues) const{ //cout<<"Sparse: "<<*internalStruct<<endl; if(internalStruct->find("VBZ")!=std::string::npos) - sparseValues["NT_VBZ"] = 1; + sparseValues["NTVBZ"] = 1; if(internalStruct->find("VBD")!=std::string::npos) - sparseValues["NT_VBD"] = 1; + sparseValues["NTVBD"] = 1; + if(internalStruct->find("VBP")!=std::string::npos) + sparseValues["NTVBP"] = 1; + if(internalStruct->find("PP")!=std::string::npos) + sparseValues["NTPP"] = 1; + if(internalStruct->find("SBAR")!=std::string::npos) + sparseValues["NTSBAR"] = 1; } |