diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-07-05 02:38:18 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-07-05 02:38:18 +0400 |
commit | 574d186708f2a4b0aa31a32725e8f13a63b2e09c (patch) | |
tree | 998ce313872a6dcb996e0daa149d91d866735cfd /moses/DecodeStepTranslation.cpp | |
parent | 0efcf64c28adb904367251cb036a7f16e1e4f834 (diff) |
beautify
Diffstat (limited to 'moses/DecodeStepTranslation.cpp')
-rw-r--r-- | moses/DecodeStepTranslation.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/moses/DecodeStepTranslation.cpp b/moses/DecodeStepTranslation.cpp index 7151c681c..b48daf7e5 100644 --- a/moses/DecodeStepTranslation.cpp +++ b/moses/DecodeStepTranslation.cpp @@ -101,57 +101,57 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO } void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslOpt - , const DecodeStep &decodeStep - , PartialTranslOptColl &outputPartialTranslOptColl - , TranslationOptionCollection *toc - , bool adhereTableLimit - , const Phrase &src - , const TargetPhraseCollection *phraseColl) const + , const DecodeStep &decodeStep + , PartialTranslOptColl &outputPartialTranslOptColl + , TranslationOptionCollection *toc + , bool adhereTableLimit + , const Phrase &src + , const TargetPhraseCollection *phraseColl) const { if (inputPartialTranslOpt.GetTargetPhrase().GetSize() == 0) { - // word deletion - outputPartialTranslOptColl.Add(new TranslationOption(inputPartialTranslOpt)); - return; + // word deletion + outputPartialTranslOptColl.Add(new TranslationOption(inputPartialTranslOpt)); + return; } // normal trans step const WordsRange &sourceWordsRange = inputPartialTranslOpt.GetSourceWordsRange(); const PhraseDictionary* phraseDictionary = - decodeStep.GetPhraseDictionaryFeature(); + decodeStep.GetPhraseDictionaryFeature(); const TargetPhrase &inPhrase = inputPartialTranslOpt.GetTargetPhrase(); const size_t currSize = inPhrase.GetSize(); const size_t tableLimit = phraseDictionary->GetTableLimit(); if (phraseColl != NULL) { - TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; - iterEnd = (!adhereTableLimit || tableLimit == 0 || phraseColl->GetSize() < tableLimit) ? phraseColl->end() : phraseColl->begin() + tableLimit; + TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; + iterEnd = (!adhereTableLimit || tableLimit == 0 || phraseColl->GetSize() < tableLimit) ? phraseColl->end() : phraseColl->begin() + tableLimit; - for (iterTargetPhrase = phraseColl->begin(); iterTargetPhrase != iterEnd; ++iterTargetPhrase) { - const TargetPhrase& targetPhrase = **iterTargetPhrase; - const ScoreComponentCollection &transScores = targetPhrase.GetScoreBreakdown(); - // skip if the - if (targetPhrase.GetSize() != currSize) continue; + for (iterTargetPhrase = phraseColl->begin(); iterTargetPhrase != iterEnd; ++iterTargetPhrase) { + const TargetPhrase& targetPhrase = **iterTargetPhrase; + const ScoreComponentCollection &transScores = targetPhrase.GetScoreBreakdown(); + // skip if the + if (targetPhrase.GetSize() != currSize) continue; - TargetPhrase outPhrase(inPhrase); + TargetPhrase outPhrase(inPhrase); - if (IsFilteringStep()) { - if (!inputPartialTranslOpt.IsCompatible(targetPhrase, m_conflictFactors)) - continue; - } + if (IsFilteringStep()) { + if (!inputPartialTranslOpt.IsCompatible(targetPhrase, m_conflictFactors)) + continue; + } - outPhrase.Merge(targetPhrase, m_newOutputFactors); - outPhrase.Evaluate(src, m_featuresToApply); // need to do this as all non-transcores would be screwed up + outPhrase.Merge(targetPhrase, m_newOutputFactors); + outPhrase.Evaluate(src, m_featuresToApply); // need to do this as all non-transcores would be screwed up - TranslationOption *newTransOpt = new TranslationOption(sourceWordsRange, outPhrase); - assert(newTransOpt != NULL); + TranslationOption *newTransOpt = new TranslationOption(sourceWordsRange, outPhrase); + assert(newTransOpt != NULL); - outputPartialTranslOptColl.Add(newTransOpt ); + outputPartialTranslOptColl.Add(newTransOpt ); - } + } } else if (sourceWordsRange.GetNumWordsCovered() == 1) { - // unknown handler - //toc->ProcessUnknownWord(sourceWordsRange.GetStartPos(), factorCollection); + // unknown handler + //toc->ProcessUnknownWord(sourceWordsRange.GetStartPos(), factorCollection); } } |