mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 10:59:21 +03:00
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:
parent
9f5d530910
commit
b83fc49a1f
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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 ©); // 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 = ⦥ }
|
||||
|
||||
const Moses::WordsRange &GetSourceWordsRange() const
|
||||
{ return *m_wordsRange; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user