diff options
author | XapaJIaMnu <nheart@gmail.com> | 2015-06-25 18:36:18 +0300 |
---|---|---|
committer | XapaJIaMnu <nheart@gmail.com> | 2015-06-25 18:36:18 +0300 |
commit | 943d814f798346a14a9dd011676aa3fe192f096d (patch) | |
tree | e2e11bff59bee6823ca4f3b1c915ce920906e80e /moses/TargetPhrase.cpp | |
parent | a3ecd9f2a7d2b7a8de93f06f2fa912b1fe0f49e4 (diff) |
Duplicate constructors to include ttasksptr.Works
Diffstat (limited to 'moses/TargetPhrase.cpp')
-rw-r--r-- | moses/TargetPhrase.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp index 4976375e9..207757884 100644 --- a/moses/TargetPhrase.cpp +++ b/moses/TargetPhrase.cpp @@ -32,6 +32,7 @@ #include "Util.h" #include "AlignmentInfoCollection.h" #include "InputPath.h" +#include "TranslationTask.h" #include "moses/TranslationModel/PhraseDictionary.h" #include <boost/foreach.hpp> @@ -48,6 +49,7 @@ TargetPhrase::TargetPhrase( std::string out_string, const PhraseDictionary *pt) , m_lhsTarget(NULL) , m_ruleSource(NULL) , m_container(pt) + , m_ttask(NULL) { //ACAT @@ -58,6 +60,52 @@ TargetPhrase::TargetPhrase( std::string out_string, const PhraseDictionary *pt) NULL); } +TargetPhrase::TargetPhrase(ttasksptr& ttask, std::string out_string, const PhraseDictionary *pt) + :Phrase(0) + , m_fullScore(0.0) + , m_futureScore(0.0) + , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) + , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) + , m_lhsTarget(NULL) + , m_ruleSource(NULL) + , m_container(pt) + , m_ttask(ttask) +{ + + //ACAT + const StaticData &staticData = StaticData::Instance(); + // XXX should this really be InputFactorOrder??? + CreateFromString(Output, staticData.GetInputFactorOrder(), out_string, + // staticData.GetFactorDelimiter(), // eliminated [UG] + NULL); +} + +TargetPhrase::TargetPhrase(ttasksptr& ttask, const PhraseDictionary *pt) + :Phrase() + , m_fullScore(0.0) + , m_futureScore(0.0) + , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) + , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) + , m_lhsTarget(NULL) + , m_ruleSource(NULL) + , m_container(pt) + , m_ttask(ttask) +{ +} + +TargetPhrase::TargetPhrase(ttasksptr& ttask, const Phrase &phrase, const PhraseDictionary *pt) + : Phrase(phrase) + , m_fullScore(0.0) + , m_futureScore(0.0) + , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) + , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) + , m_lhsTarget(NULL) + , m_ruleSource(NULL) + , m_container(pt) + , m_ttask(ttask) +{ +} + TargetPhrase::TargetPhrase(const PhraseDictionary *pt) :Phrase() , m_fullScore(0.0) @@ -67,6 +115,7 @@ TargetPhrase::TargetPhrase(const PhraseDictionary *pt) , m_lhsTarget(NULL) , m_ruleSource(NULL) , m_container(pt) + , m_ttask(NULL) { } @@ -79,6 +128,7 @@ TargetPhrase::TargetPhrase(const Phrase &phrase, const PhraseDictionary *pt) , m_lhsTarget(NULL) , m_ruleSource(NULL) , m_container(pt) + , m_ttask(NULL) { } @@ -92,6 +142,7 @@ TargetPhrase::TargetPhrase(const TargetPhrase ©) , m_alignNonTerm(copy.m_alignNonTerm) , m_properties(copy.m_properties) , m_container(copy.m_container) + , m_ttask(copy.m_ttask) { if (copy.m_lhsTarget) { m_lhsTarget = new Word(*copy.m_lhsTarget); |