diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-05-02 13:45:24 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-05-02 13:45:24 +0300 |
commit | cc8c6b7b10abd8118014635609f7658f6a7a1857 (patch) | |
tree | cab374bcbf73ff97782e9131380e4f32dbeb1e67 /moses/DecodeStepTranslation.cpp | |
parent | a4a7c14593766ab188e1d6ae1c29e67ed201d412 (diff) |
beautify
Diffstat (limited to 'moses/DecodeStepTranslation.cpp')
-rw-r--r-- | moses/DecodeStepTranslation.cpp | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/moses/DecodeStepTranslation.cpp b/moses/DecodeStepTranslation.cpp index 7ea26f8a5..034c06fc2 100644 --- a/moses/DecodeStepTranslation.cpp +++ b/moses/DecodeStepTranslation.cpp @@ -218,17 +218,16 @@ const InputPath &DecodeStepTranslation::GetInputPathLEGACY( void DecodeStepTranslation:: ProcessLEGACY(TranslationOption const& in, - DecodeStep const& decodeStep, - PartialTranslOptColl &out, - TranslationOptionCollection *toc, - bool adhereTableLimit) const + DecodeStep const& decodeStep, + PartialTranslOptColl &out, + TranslationOptionCollection *toc, + bool adhereTableLimit) const { - if (in.GetTargetPhrase().GetSize() == 0) - { - // word deletion - out.Add(new TranslationOption(in)); - return; - } + if (in.GetTargetPhrase().GetSize() == 0) { + // word deletion + out.Add(new TranslationOption(in)); + return; + } // normal trans step WordsRange const& srcRange = in.GetSourceWordsRange(); @@ -241,34 +240,32 @@ ProcessLEGACY(TranslationOption const& in, TargetPhraseCollectionWithSourcePhrase const* phraseColl; phraseColl = pdict->GetTargetPhraseCollectionLEGACY(toc->GetSource(),srcRange); - if (phraseColl != NULL) - { - TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; - iterEnd = ((adhereTableLimit && tableLimit && phraseColl->GetSize() >= tableLimit) - ? phraseColl->begin() + tableLimit : phraseColl->end()); + if (phraseColl != NULL) { + TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; + iterEnd = ((adhereTableLimit && tableLimit && phraseColl->GetSize() >= tableLimit) + ? phraseColl->begin() + tableLimit : phraseColl->end()); - for (iterTargetPhrase = phraseColl->begin(); - iterTargetPhrase != iterEnd; - ++iterTargetPhrase) - { - TargetPhrase const& targetPhrase = **iterTargetPhrase; - if (targetPhrase.GetSize() != currSize || - (IsFilteringStep() && !in.IsCompatible(targetPhrase, m_conflictFactors))) - continue; + for (iterTargetPhrase = phraseColl->begin(); + iterTargetPhrase != iterEnd; + ++iterTargetPhrase) { + TargetPhrase const& targetPhrase = **iterTargetPhrase; + if (targetPhrase.GetSize() != currSize || + (IsFilteringStep() && !in.IsCompatible(targetPhrase, m_conflictFactors))) + continue; - TargetPhrase outPhrase(inPhrase); - outPhrase.Merge(targetPhrase, m_newOutputFactors); - outPhrase.EvaluateInIsolation(inputPath.GetPhrase(), m_featuresToApply); // need to do this as all non-transcores would be screwed up + TargetPhrase outPhrase(inPhrase); + outPhrase.Merge(targetPhrase, m_newOutputFactors); + outPhrase.EvaluateInIsolation(inputPath.GetPhrase(), m_featuresToApply); // need to do this as all non-transcores would be screwed up - TranslationOption *newTransOpt = new TranslationOption(srcRange, outPhrase); - assert(newTransOpt != NULL); + TranslationOption *newTransOpt = new TranslationOption(srcRange, outPhrase); + assert(newTransOpt != NULL); - newTransOpt->SetInputPath(inputPath); + newTransOpt->SetInputPath(inputPath); - out.Add(newTransOpt); + out.Add(newTransOpt); - } } + } } } |