make class name consistent for chart & pb decoders

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3553 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
hieuhoang1972 2010-09-23 11:05:38 +00:00
parent 9f5d530910
commit b83fc49a1f
3 changed files with 12 additions and 3 deletions

View File

@ -34,10 +34,11 @@ namespace MosesChart
TranslationOption::TranslationOption(const WordsRange &wordsRange
, const ChartRule &rule)
:m_rule(rule)
,m_wordsRange(wordsRange)
{
//assert(wordsRange.GetStartPos() == rule.GetWordsConsumed().front()->GetWordsRange().GetStartPos());
assert(wordsRange.GetEndPos() == rule.GetLastWordConsumed().GetWordsRange().GetEndPos());
rule.SetWordsRange(wordsRange);
}
TranslationOption::~TranslationOption()

View File

@ -36,7 +36,6 @@ class TranslationOption
protected:
const Moses::ChartRule &m_rule; /*< output phrase when using this translation option */
const Moses::WordsRange &m_wordsRange;
public:
TranslationOption(const Moses::WordsRange &wordsRange
, const Moses::ChartRule &chartRule);
@ -53,7 +52,7 @@ public:
{ return m_rule.GetLastWordConsumed(); }
const Moses::WordsRange &GetSourceWordsRange() const
{ return m_wordsRange; }
{ return m_rule.GetSourceWordsRange(); }
/** return estimate of total cost of this option */
inline size_t GetArity() const

View File

@ -47,6 +47,7 @@ protected:
Usually filled with NOT_KNOWN, unless the pos is a non-term, in which case its filled
with its index
*/
mutable const WordsRange *m_wordsRange;
ChartRule(const ChartRule &copy); // not implmenented
@ -69,6 +70,14 @@ public:
{ return m_wordsConsumedTargetOrder; }
void CreateNonTermIndex();
// used inside chart decoder. must make words range mutable. hack
void SetWordsRange(const WordsRange &range) const
{ m_wordsRange = &range; }
const Moses::WordsRange &GetSourceWordsRange() const
{ return *m_wordsRange; }
};
}