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:
authorHieu Hoang <hieu@hoang.co.uk>2013-08-07 15:11:39 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-08-07 15:11:39 +0400
commit24c4c8f2106fc56f12702f72f05732253bd9209d (patch)
treecb69501632ab8e4b7c7cd944d49aec123de86b17 /moses/TranslationOptionCollectionConfusionNet.cpp
parent89f39bf89dc6db74ecbe86263088f0967468f1e3 (diff)
mark a function as legacy
Diffstat (limited to 'moses/TranslationOptionCollectionConfusionNet.cpp')
-rw-r--r--moses/TranslationOptionCollectionConfusionNet.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/moses/TranslationOptionCollectionConfusionNet.cpp b/moses/TranslationOptionCollectionConfusionNet.cpp
index 6183d57d3..5c58c3f3c 100644
--- a/moses/TranslationOptionCollectionConfusionNet.cpp
+++ b/moses/TranslationOptionCollectionConfusionNet.cpp
@@ -5,6 +5,7 @@
#include "ConfusionNet.h"
#include "DecodeStep.h"
#include "DecodeStepTranslation.h"
+#include "DecodeStepGeneration.h"
#include "FactorCollection.h"
#include "FF/InputFeature.h"
#include "TranslationModel/PhraseDictionaryTreeAdaptor.h"
@@ -210,7 +211,10 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLe
for (++iterStep ; iterStep != decodeGraph.end() ; ++iterStep) {
- const DecodeStep &decodeStep = **iterStep;
+ const DecodeStep *decodeStep = *iterStep;
+ const DecodeStepTranslation *transStep =dynamic_cast<const DecodeStepTranslation*>(decodeStep);
+ const DecodeStepGeneration *genStep =dynamic_cast<const DecodeStepGeneration*>(decodeStep);
+
PartialTranslOptColl* newPtoc = new PartialTranslOptColl;
// go thru each intermediate trans opt just created
@@ -219,12 +223,23 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLe
for (iterPartialTranslOpt = partTransOptList.begin() ; iterPartialTranslOpt != partTransOptList.end() ; ++iterPartialTranslOpt) {
TranslationOption &inputPartialTranslOpt = **iterPartialTranslOpt;
- decodeStep.Process(inputPartialTranslOpt
- , decodeStep
+ if (transStep) {
+ transStep->ProcessLegacy(inputPartialTranslOpt
+ , *decodeStep
, *newPtoc
, this
, adhereTableLimit
, *sourcePhrase);
+ }
+ else {
+ CHECK(genStep);
+ genStep->Process(inputPartialTranslOpt
+ , *decodeStep
+ , *newPtoc
+ , this
+ , adhereTableLimit
+ , *sourcePhrase);
+ }
}
// last but 1 partial trans not required anymore