diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-02-06 02:04:53 +0300 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-02-06 02:04:53 +0300 |
commit | 006297831c063fc1a688693eb8e40030a02c75d4 (patch) | |
tree | 2d4743b1651a32612fb7dcdf09caf8893bccf86d /moses/TranslationOptionCollection.h | |
parent | c464420586ba370c8508fcfd80e777cf2b226f3a (diff) |
Changed return types of member functions CreateTranslationOptionsForRange(...) and GetTranslationOptionList(...).
Diffstat (limited to 'moses/TranslationOptionCollection.h')
-rw-r--r-- | moses/TranslationOptionCollection.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/moses/TranslationOptionCollection.h b/moses/TranslationOptionCollection.h index 6efec2a8a..a3258c2b9 100644 --- a/moses/TranslationOptionCollection.h +++ b/moses/TranslationOptionCollection.h @@ -1,3 +1,4 @@ +// -*- c++ -*- // $Id$ /*********************************************************************** @@ -88,9 +89,17 @@ protected: //! sort all trans opt in each list for cube pruning */ void Sort(); +public: + // is there any good reason not to make these public? UG + //! list of trans opt for a particular span - TranslationOptionList &GetTranslationOptionList(size_t startPos, size_t endPos); - const TranslationOptionList &GetTranslationOptionList(size_t startPos, size_t endPos) const; + TranslationOptionList* + GetTranslationOptionList(size_t startPos, size_t endPos); + + TranslationOptionList const* + GetTranslationOptionList(size_t startPos, size_t endPos) const; + +protected: void Add(TranslationOption *translationOption); //! implemented by inherited class, called by this class @@ -102,7 +111,7 @@ protected: void GetTargetPhraseCollectionBatch(); - void CreateTranslationOptionsForRange( + bool CreateTranslationOptionsForRange( const DecodeGraph &decodeGraph , size_t startPos , size_t endPos @@ -127,15 +136,20 @@ public: //! Create all possible translations from the phrase tables virtual void CreateTranslationOptions(); - //! Create translation options that exactly cover a specific input span. - virtual void CreateTranslationOptionsForRange(const DecodeGraph &decodeStepList - , size_t startPosition - , size_t endPosition - , bool adhereTableLimit - , size_t graphInd) = 0; + //! Create translation options that exactly cover a specific input span. + virtual + bool + CreateTranslationOptionsForRange + (const DecodeGraph &decodeStepList, + size_t startPosition, size_t endPosition, + bool adhereTableLimit, size_t graphInd) = 0; + //!Check if this range has XML options - virtual bool HasXmlOptionsOverlappingRange(size_t startPosition, size_t endPosition) const; + virtual + bool + HasXmlOptionsOverlappingRange(size_t startPosition, + size_t endPosition) const; //! Check if a subsumed XML option constraint is satisfied virtual bool ViolatesXmlOptionsConstraint(size_t startPosition, size_t endPosition, TranslationOption *transOpt) const; @@ -150,7 +164,9 @@ public: } //! list of trans opt for a particular span - const TranslationOptionList &GetTranslationOptionList(const WordsRange &coverage) const { + TranslationOptionList const* + GetTranslationOptionList(const WordsRange &coverage) const + { return GetTranslationOptionList(coverage.GetStartPos(), coverage.GetEndPos()); } |