Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-10-18 23:27:58 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-10-18 23:27:58 +0300
commitbdb0227ee9648ea96e8ee266d32581c63762b8b0 (patch)
tree5aff9707a743b3ec5f0e16cba70771b7299516f0 /moses/DecodeStepTranslation.cpp
parent7a85126a926c4ffdbd0a956b3b4cec07eea33ed2 (diff)
Life cycle of TargetPhraseCollection is now managed via shared pointers.
Diffstat (limited to 'moses/DecodeStepTranslation.cpp')
-rw-r--r--moses/DecodeStepTranslation.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/moses/DecodeStepTranslation.cpp b/moses/DecodeStepTranslation.cpp
index 034c06fc2..f2a5722e1 100644
--- a/moses/DecodeStepTranslation.cpp
+++ b/moses/DecodeStepTranslation.cpp
@@ -49,7 +49,7 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO
, PartialTranslOptColl &outputPartialTranslOptColl
, TranslationOptionCollection *toc
, bool adhereTableLimit
- , const TargetPhraseCollection *phraseColl) const
+ , TargetPhraseCollection::shared_ptr phraseColl) const
{
if (inputPartialTranslOpt.GetTargetPhrase().GetSize() == 0) {
// word deletion
@@ -105,7 +105,7 @@ void DecodeStepTranslation::ProcessInitialTranslation(
,PartialTranslOptColl &outputPartialTranslOptColl
, size_t startPos, size_t endPos, bool adhereTableLimit
, const InputPath &inputPath
- , const TargetPhraseCollection *phraseColl) const
+ , TargetPhraseCollection::shared_ptr phraseColl) const
{
const PhraseDictionary* phraseDictionary = GetPhraseDictionaryFeature();
const size_t tableLimit = phraseDictionary->GetTableLimit();
@@ -147,7 +147,8 @@ void DecodeStepTranslation::ProcessInitialTranslationLEGACY(
const size_t tableLimit = phraseDictionary->GetTableLimit();
const WordsRange wordsRange(startPos, endPos);
- const TargetPhraseCollectionWithSourcePhrase *phraseColl = phraseDictionary->GetTargetPhraseCollectionLEGACY(source,wordsRange);
+ TargetPhraseCollectionWithSourcePhrase::shared_ptr phraseColl
+ = phraseDictionary->GetTargetPhraseCollectionLEGACY(source,wordsRange);
if (phraseColl != NULL) {
IFVERBOSE(3) {
@@ -237,8 +238,8 @@ ProcessLEGACY(TranslationOption const& in,
size_t const currSize = inPhrase.GetSize();
size_t const tableLimit = pdict->GetTableLimit();
- TargetPhraseCollectionWithSourcePhrase const* phraseColl;
- phraseColl = pdict->GetTargetPhraseCollectionLEGACY(toc->GetSource(),srcRange);
+ TargetPhraseCollectionWithSourcePhrase::shared_ptr phraseColl
+ = pdict->GetTargetPhraseCollectionLEGACY(toc->GetSource(),srcRange);
if (phraseColl != NULL) {
TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd;