diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-13 13:33:04 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-13 13:33:04 +0400 |
commit | 4676bca90ff8e67df4c3c034153a70dc25585d4c (patch) | |
tree | 25121e454d32ab97bc7bd38a3174082064a4c518 | |
parent | 154ca336d691f787cf75e59e27aa963a00c62c81 (diff) |
minor renaming
-rw-r--r-- | moses/ChartHypothesis.cpp | 2 | ||||
-rw-r--r-- | moses/ChartHypothesis.h | 8 | ||||
-rw-r--r-- | moses/RuleCube.h | 2 | ||||
-rw-r--r-- | moses/RuleCubeItem.cpp | 2 | ||||
-rw-r--r-- | moses/RuleCubeItem.h | 6 |
5 files changed, 12 insertions, 8 deletions
diff --git a/moses/ChartHypothesis.cpp b/moses/ChartHypothesis.cpp index 02c486ad3..c3f090b64 100644 --- a/moses/ChartHypothesis.cpp +++ b/moses/ChartHypothesis.cpp @@ -47,7 +47,7 @@ ObjectPool<ChartHypothesis> ChartHypothesis::s_objectPool("ChartHypothesis", 300 ChartHypothesis::ChartHypothesis(const ChartTranslationOptions &transOpt, const RuleCubeItem &item, ChartManager &manager) - :m_targetPhrase(item.GetTranslationDimension().GetTargetPhrase()) + :m_transOpt(item.GetTranslationDimension().GetTranslationOption()) ,m_currSourceWordsRange(transOpt.GetSourceWordsRange()) ,m_ffStates(StatefulFeatureFunction::GetStatefulFeatureFunctions().size()) ,m_arcList(NULL) diff --git a/moses/ChartHypothesis.h b/moses/ChartHypothesis.h index 6de33dd72..c810ddaed 100644 --- a/moses/ChartHypothesis.h +++ b/moses/ChartHypothesis.h @@ -49,7 +49,7 @@ protected: static ObjectPool<ChartHypothesis> s_objectPool; #endif - boost::shared_ptr<ChartTranslationOption> m_targetPhrase; + boost::shared_ptr<ChartTranslationOption> m_transOpt; WordsRange m_currSourceWordsRange; std::vector<const FFState*> m_ffStates; /*! stateful feature function states */ @@ -100,9 +100,13 @@ public: return m_id; } + const ChartTranslationOption &GetTranslationOption()const { + return *m_transOpt; + } + //! Get the rule that created this hypothesis const TargetPhrase &GetCurrTargetPhrase()const { - return m_targetPhrase->GetPhrase(); + return m_transOpt->GetPhrase(); } //! the source range that this hypothesis spans diff --git a/moses/RuleCube.h b/moses/RuleCube.h index d0c6ea66a..10dea70ad 100644 --- a/moses/RuleCube.h +++ b/moses/RuleCube.h @@ -70,7 +70,7 @@ public: size_t operator()(const RuleCubeItem *p) const { size_t seed = 0; boost::hash_combine(seed, p->GetHypothesisDimensions()); - boost::hash_combine(seed, p->GetTranslationDimension().GetTargetPhrase()); + boost::hash_combine(seed, p->GetTranslationDimension().GetTranslationOption()); return seed; } }; diff --git a/moses/RuleCubeItem.cpp b/moses/RuleCubeItem.cpp index 47703a630..9c5c9f544 100644 --- a/moses/RuleCubeItem.cpp +++ b/moses/RuleCubeItem.cpp @@ -65,7 +65,7 @@ RuleCubeItem::~RuleCubeItem() void RuleCubeItem::EstimateScore() { - m_score = m_translationDimension.GetTargetPhrase()->GetPhrase().GetFutureScore(); + m_score = m_translationDimension.GetTranslationOption()->GetPhrase().GetFutureScore(); std::vector<HypothesisDimension>::const_iterator p; for (p = m_hypothesisDimensions.begin(); p != m_hypothesisDimensions.end(); ++p) { diff --git a/moses/RuleCubeItem.h b/moses/RuleCubeItem.h index 2c086f0b3..0abc905f7 100644 --- a/moses/RuleCubeItem.h +++ b/moses/RuleCubeItem.h @@ -53,16 +53,16 @@ public: return m_pos+1 < m_orderedTargetPhrases.size(); } - const boost::shared_ptr<ChartTranslationOption> &GetTargetPhrase() const { + const boost::shared_ptr<ChartTranslationOption> &GetTranslationOption() const { return m_orderedTargetPhrases[m_pos]; } bool operator<(const TranslationDimension &compare) const { - return GetTargetPhrase() < compare.GetTargetPhrase(); + return GetTranslationOption()->GetPhrase() < compare.GetTranslationOption()->GetPhrase(); } bool operator==(const TranslationDimension &compare) const { - return GetTargetPhrase() == compare.GetTargetPhrase(); + return GetTranslationOption()->GetPhrase() == compare.GetTranslationOption()->GetPhrase(); } private: |