diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-10-31 15:50:52 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-10-31 15:50:52 +0300 |
commit | 324c378f7fc54f02a8ea264915d3eade867ff23d (patch) | |
tree | 2bb934fee448845b0524427d437c871e7118ac2c /moses/DecodeStepTranslation.cpp | |
parent | dc8ad899454bd82408c6a371d5f50e497ede0caa (diff) |
Options refactoring. Moses crashed in server mode when asked to provide n-best translations with scores.
Diffstat (limited to 'moses/DecodeStepTranslation.cpp')
-rw-r--r-- | moses/DecodeStepTranslation.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/moses/DecodeStepTranslation.cpp b/moses/DecodeStepTranslation.cpp index c593f8ebc..25d160626 100644 --- a/moses/DecodeStepTranslation.cpp +++ b/moses/DecodeStepTranslation.cpp @@ -100,12 +100,14 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO } } -void DecodeStepTranslation::ProcessInitialTranslation( - const InputType &source - ,PartialTranslOptColl &outputPartialTranslOptColl - , size_t startPos, size_t endPos, bool adhereTableLimit - , const InputPath &inputPath - , TargetPhraseCollection::shared_ptr phraseColl) const +void +DecodeStepTranslation:: +ProcessInitialTranslation(InputType const& source, + PartialTranslOptColl &outputPartialTranslOptColl, + size_t startPos, size_t endPos, + bool adhereTableLimit, + InputPath const& inputPath, + TargetPhraseCollection::shared_ptr phraseColl) const { const PhraseDictionary* phraseDictionary = GetPhraseDictionaryFeature(); const size_t tableLimit = phraseDictionary->GetTableLimit(); @@ -114,12 +116,13 @@ void DecodeStepTranslation::ProcessInitialTranslation( if (phraseColl != NULL) { IFVERBOSE(3) { - if(StaticData::Instance().GetInputType() == SentenceInput) - TRACE_ERR("[" << source.GetSubString(range) << "; " << startPos << "-" << endPos << "]\n"); + if(source.GetType() == SentenceInput) + TRACE_ERR("[" << source.GetSubString(range) << "; " + << startPos << "-" << endPos << "]\n"); else TRACE_ERR("[" << startPos << "-" << endPos << "]" << std::endl); } - + TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; iterEnd = (!adhereTableLimit || tableLimit == 0 || phraseColl->GetSize() < tableLimit) ? phraseColl->end() : phraseColl->begin() + tableLimit; @@ -137,11 +140,13 @@ void DecodeStepTranslation::ProcessInitialTranslation( } } -void DecodeStepTranslation::ProcessInitialTranslationLEGACY( - const InputType &source - ,PartialTranslOptColl &outputPartialTranslOptColl - , size_t startPos, size_t endPos, bool adhereTableLimit - , const InputPathList &inputPathList) const +void +DecodeStepTranslation:: +ProcessInitialTransLEGACY(InputType const& source, + PartialTranslOptColl &outputPartialTranslOptColl, + size_t startPos, size_t endPos, + bool adhereTableLimit, + InputPathList const& inputPathList) const { const PhraseDictionary* phraseDictionary = GetPhraseDictionaryFeature(); const size_t tableLimit = phraseDictionary->GetTableLimit(); @@ -152,12 +157,13 @@ void DecodeStepTranslation::ProcessInitialTranslationLEGACY( if (phraseColl != NULL) { IFVERBOSE(3) { - if(StaticData::Instance().GetInputType() == SentenceInput) - TRACE_ERR("[" << source.GetSubString(range) << "; " << startPos << "-" << endPos << "]\n"); + if(source.GetType() == SentenceInput) + TRACE_ERR("[" << source.GetSubString(range) << "; " + << startPos << "-" << endPos << "]\n"); else TRACE_ERR("[" << startPos << "-" << endPos << "]" << std::endl); } - + const std::vector<Phrase> &sourcePhrases = phraseColl->GetSourcePhrases(); TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; |