minor renaming

This commit is contained in:
Hieu Hoang 2013-08-13 10:33:04 +01:00
parent 154ca336d6
commit 4676bca90f
5 changed files with 12 additions and 8 deletions

View File

@ -47,7 +47,7 @@ ObjectPool<ChartHypothesis> ChartHypothesis::s_objectPool("ChartHypothesis", 300
ChartHypothesis::ChartHypothesis(const ChartTranslationOptions &transOpt, ChartHypothesis::ChartHypothesis(const ChartTranslationOptions &transOpt,
const RuleCubeItem &item, const RuleCubeItem &item,
ChartManager &manager) ChartManager &manager)
:m_targetPhrase(item.GetTranslationDimension().GetTargetPhrase()) :m_transOpt(item.GetTranslationDimension().GetTranslationOption())
,m_currSourceWordsRange(transOpt.GetSourceWordsRange()) ,m_currSourceWordsRange(transOpt.GetSourceWordsRange())
,m_ffStates(StatefulFeatureFunction::GetStatefulFeatureFunctions().size()) ,m_ffStates(StatefulFeatureFunction::GetStatefulFeatureFunctions().size())
,m_arcList(NULL) ,m_arcList(NULL)

View File

@ -49,7 +49,7 @@ protected:
static ObjectPool<ChartHypothesis> s_objectPool; static ObjectPool<ChartHypothesis> s_objectPool;
#endif #endif
boost::shared_ptr<ChartTranslationOption> m_targetPhrase; boost::shared_ptr<ChartTranslationOption> m_transOpt;
WordsRange m_currSourceWordsRange; WordsRange m_currSourceWordsRange;
std::vector<const FFState*> m_ffStates; /*! stateful feature function states */ std::vector<const FFState*> m_ffStates; /*! stateful feature function states */
@ -100,9 +100,13 @@ public:
return m_id; return m_id;
} }
const ChartTranslationOption &GetTranslationOption()const {
return *m_transOpt;
}
//! Get the rule that created this hypothesis //! Get the rule that created this hypothesis
const TargetPhrase &GetCurrTargetPhrase()const { const TargetPhrase &GetCurrTargetPhrase()const {
return m_targetPhrase->GetPhrase(); return m_transOpt->GetPhrase();
} }
//! the source range that this hypothesis spans //! the source range that this hypothesis spans

View File

@ -70,7 +70,7 @@ public:
size_t operator()(const RuleCubeItem *p) const { size_t operator()(const RuleCubeItem *p) const {
size_t seed = 0; size_t seed = 0;
boost::hash_combine(seed, p->GetHypothesisDimensions()); boost::hash_combine(seed, p->GetHypothesisDimensions());
boost::hash_combine(seed, p->GetTranslationDimension().GetTargetPhrase()); boost::hash_combine(seed, p->GetTranslationDimension().GetTranslationOption());
return seed; return seed;
} }
}; };

View File

@ -65,7 +65,7 @@ RuleCubeItem::~RuleCubeItem()
void RuleCubeItem::EstimateScore() void RuleCubeItem::EstimateScore()
{ {
m_score = m_translationDimension.GetTargetPhrase()->GetPhrase().GetFutureScore(); m_score = m_translationDimension.GetTranslationOption()->GetPhrase().GetFutureScore();
std::vector<HypothesisDimension>::const_iterator p; std::vector<HypothesisDimension>::const_iterator p;
for (p = m_hypothesisDimensions.begin(); for (p = m_hypothesisDimensions.begin();
p != m_hypothesisDimensions.end(); ++p) { p != m_hypothesisDimensions.end(); ++p) {

View File

@ -53,16 +53,16 @@ public:
return m_pos+1 < m_orderedTargetPhrases.size(); 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]; return m_orderedTargetPhrases[m_pos];
} }
bool operator<(const TranslationDimension &compare) const { bool operator<(const TranslationDimension &compare) const {
return GetTargetPhrase() < compare.GetTargetPhrase(); return GetTranslationOption()->GetPhrase() < compare.GetTranslationOption()->GetPhrase();
} }
bool operator==(const TranslationDimension &compare) const { bool operator==(const TranslationDimension &compare) const {
return GetTargetPhrase() == compare.GetTargetPhrase(); return GetTranslationOption()->GetPhrase() == compare.GetTranslationOption()->GetPhrase();
} }
private: private: