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:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-10-23 23:49:09 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-10-23 23:49:09 +0300
commit8ace1398eb4e38a288c4e35966e722e39561c1b5 (patch)
treefe6c096a1769cbb65761d8e89bfbb96cf3d1ffce /moses/TargetPhrase.cpp
parentb5c4ab32b44c41557c20b7c39bd6f9f6854cf9fc (diff)
Added GetTtask() and HasTtaskSPtr() to Phrase API; non-TargetPhrases never have a ttask associated with them, but we need to be able to check.
Diffstat (limited to 'moses/TargetPhrase.cpp')
-rw-r--r--moses/TargetPhrase.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp
index 9f27e1be8..cd9e579c3 100644
--- a/moses/TargetPhrase.cpp
+++ b/moses/TargetPhrase.cpp
@@ -42,7 +42,6 @@ namespace Moses
{
TargetPhrase::TargetPhrase( std::string out_string, const PhraseDictionary *pt)
:Phrase(0)
- , m_ttask_flag(false)
, m_fullScore(0.0)
, m_futureScore(0.0)
, m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
@@ -62,7 +61,6 @@ TargetPhrase::TargetPhrase( std::string out_string, const PhraseDictionary *pt)
TargetPhrase::TargetPhrase(ttasksptr& ttask, std::string out_string, const PhraseDictionary *pt)
:Phrase(0)
, m_ttask(ttask)
- , m_ttask_flag(true)
, m_fullScore(0.0)
, m_futureScore(0.0)
, m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
@@ -83,7 +81,6 @@ TargetPhrase::TargetPhrase(ttasksptr& ttask, std::string out_string, const Phras
TargetPhrase::TargetPhrase(ttasksptr& ttask, const PhraseDictionary *pt)
:Phrase()
, m_ttask(ttask)
- , m_ttask_flag(true)
, m_fullScore(0.0)
, m_futureScore(0.0)
, m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
@@ -103,7 +100,6 @@ TargetPhrase::TargetPhrase(ttasksptr& ttask, const Phrase &phrase, const PhraseD
, m_lhsTarget(NULL)
, m_ruleSource(NULL)
, m_ttask(ttask)
- , m_ttask_flag(true)
, m_container(pt)
{
}
@@ -116,7 +112,6 @@ TargetPhrase::TargetPhrase(const PhraseDictionary *pt)
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
, m_lhsTarget(NULL)
, m_ruleSource(NULL)
- , m_ttask_flag(false)
, m_container(pt)
{
}
@@ -129,7 +124,6 @@ TargetPhrase::TargetPhrase(const Phrase &phrase, const PhraseDictionary *pt)
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
, m_lhsTarget(NULL)
, m_ruleSource(NULL)
- , m_ttask_flag(false)
, m_container(pt)
{
}
@@ -144,7 +138,6 @@ TargetPhrase::TargetPhrase(const TargetPhrase &copy)
, m_alignNonTerm(copy.m_alignNonTerm)
, m_properties(copy.m_properties)
, m_ttask(copy.m_ttask)
- , m_ttask_flag(copy.m_ttask_flag)
, m_container(copy.m_container)
{
if (copy.m_lhsTarget) {
@@ -179,10 +172,10 @@ void TargetPhrase::WriteToRulePB(hgmert::Rule* pb) const
bool TargetPhrase::HasTtaskSPtr() const
{
- return m_ttask_flag;
+ return !m_ttask.expired();
}
-const ttasksptr TargetPhrase::GetTtask() const
+ttasksptr TargetPhrase::GetTtask() const
{
return m_ttask.lock();
}