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-06-28 21:05:49 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-06-28 21:05:49 +0400
commitbddbdeec0448eabd260bb034262d53990846482e (patch)
treed390d6ee843806e4e99fa10cac102f42e306ecfa /moses/TranslationOptionCollectionText.cpp
parentd2e37b701b1c2753860b4a4c7adf46b7eadfba4c (diff)
find all target phrases before search
Diffstat (limited to 'moses/TranslationOptionCollectionText.cpp')
-rw-r--r--moses/TranslationOptionCollectionText.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/moses/TranslationOptionCollectionText.cpp b/moses/TranslationOptionCollectionText.cpp
index 83c514e32..0ef777c03 100644
--- a/moses/TranslationOptionCollectionText.cpp
+++ b/moses/TranslationOptionCollectionText.cpp
@@ -122,6 +122,8 @@ void TranslationOptionCollectionText::CreateTranslationOptionsForRange(
, bool adhereTableLimit
, size_t graphInd)
{
+ InputLatticeNode &inputLatticeNode = GetInputLatticeNode(startPos, endPos);
+
if ((StaticData::Instance().GetXmlInputType() != XmlExclusive) || !HasXmlOptionsOverlappingRange(startPos,endPos)) {
Phrase *sourcePhrase = NULL; // can't initialise with substring, in case it's confusion network
@@ -153,9 +155,13 @@ void TranslationOptionCollectionText::CreateTranslationOptionsForRange(
list <const DecodeStep* >::const_iterator iterStep = decodeGraph.begin();
const DecodeStep &decodeStep = **iterStep;
+ const PhraseDictionary &phraseDictionary = *decodeStep.GetPhraseDictionaryFeature();
+ const TargetPhraseCollection *targetPhrases = inputLatticeNode.GetTargetPhrases(phraseDictionary);
+
static_cast<const DecodeStepTranslation&>(decodeStep).ProcessInitialTranslation
(m_source, *oldPtoc
- , startPos, endPos, adhereTableLimit );
+ , startPos, endPos, adhereTableLimit
+ , targetPhrases);
// do rest of decode steps
int indexStep = 0;