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-13 23:36:32 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-08-13 23:36:32 +0400
commitefc765ddff5c97c99aa314de0a0d9af4944a3688 (patch)
treed616dc8533400f30308acc22005f49a2e1ca2a2a /moses/DecodeStepTranslation.cpp
parentc50cc18f36dd121b67da958d136b4a68d5d42830 (diff)
implement Evaluate(inputpath, input) for chart translation options. Plumbing for lattice input
Diffstat (limited to 'moses/DecodeStepTranslation.cpp')
-rw-r--r--moses/DecodeStepTranslation.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/moses/DecodeStepTranslation.cpp b/moses/DecodeStepTranslation.cpp
index 541c876e1..19aac0793 100644
--- a/moses/DecodeStepTranslation.cpp
+++ b/moses/DecodeStepTranslation.cpp
@@ -59,7 +59,7 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO
// normal trans step
const WordsRange &sourceWordsRange = inputPartialTranslOpt.GetSourceWordsRange();
- const Phrase &sourcePhrase = inputPartialTranslOpt.GetSourcePhrase();
+ const InputPath &inputPath = inputPartialTranslOpt.GetInputPath();
const PhraseDictionary* phraseDictionary =
decodeStep.GetPhraseDictionaryFeature();
const TargetPhrase &inPhrase = inputPartialTranslOpt.GetTargetPhrase();
@@ -84,12 +84,12 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO
}
outPhrase.Merge(targetPhrase, m_newOutputFactors);
- outPhrase.Evaluate(sourcePhrase, m_featuresToApply); // need to do this as all non-transcores would be screwed up
+ outPhrase.Evaluate(inputPath.GetPhrase(), m_featuresToApply); // need to do this as all non-transcores would be screwed up
TranslationOption *newTransOpt = new TranslationOption(sourceWordsRange, outPhrase);
assert(newTransOpt != NULL);
- newTransOpt->SetSourcePhrase(sourcePhrase);
+ newTransOpt->SetInputPath(inputPath);
outputPartialTranslOptColl.Add(newTransOpt );
@@ -104,7 +104,7 @@ void DecodeStepTranslation::ProcessInitialTranslation(
const InputType &source
,PartialTranslOptColl &outputPartialTranslOptColl
, size_t startPos, size_t endPos, bool adhereTableLimit
- , const Phrase &sourcePhrase
+ , const InputPath &inputPath
, const TargetPhraseCollection *phraseColl) const
{
const PhraseDictionary* phraseDictionary = GetPhraseDictionaryFeature();
@@ -127,7 +127,7 @@ void DecodeStepTranslation::ProcessInitialTranslation(
const TargetPhrase &targetPhrase = **iterTargetPhrase;
TranslationOption *transOpt = new TranslationOption(wordsRange, targetPhrase);
- transOpt->SetSourcePhrase(sourcePhrase);
+ transOpt->SetInputPath(inputPath);
outputPartialTranslOptColl.Add (transOpt);
@@ -174,7 +174,7 @@ void DecodeStepTranslation::ProcessInitialTranslationLegacy(
const InputPath &inputPath = GetInputPathLegacy(targetPhrase, sourcePhrase, inputPathList);
TranslationOption *transOpt = new TranslationOption(wordsRange, targetPhrase);
- transOpt->SetSourcePhrase(inputPath.GetPhrase());
+ transOpt->SetInputPath(inputPath);
outputPartialTranslOptColl.Add (transOpt);
@@ -221,7 +221,7 @@ void DecodeStepTranslation::ProcessLegacy(const TranslationOption &inputPartialT
// normal trans step
const WordsRange &sourceWordsRange = inputPartialTranslOpt.GetSourceWordsRange();
- const Phrase &sourcePhrase = inputPartialTranslOpt.GetSourcePhrase();
+ const InputPath &inputPath = inputPartialTranslOpt.GetInputPath();
const PhraseDictionary* phraseDictionary =
decodeStep.GetPhraseDictionaryFeature();
const TargetPhrase &inPhrase = inputPartialTranslOpt.GetTargetPhrase();
@@ -250,13 +250,13 @@ void DecodeStepTranslation::ProcessLegacy(const TranslationOption &inputPartialT
}
outPhrase.Merge(targetPhrase, m_newOutputFactors);
- outPhrase.Evaluate(sourcePhrase, m_featuresToApply); // need to do this as all non-transcores would be screwed up
+ outPhrase.Evaluate(inputPath.GetPhrase(), m_featuresToApply); // need to do this as all non-transcores would be screwed up
TranslationOption *newTransOpt = new TranslationOption(sourceWordsRange, outPhrase);
assert(newTransOpt != NULL);
- newTransOpt->SetSourcePhrase(sourcePhrase);
+ newTransOpt->SetInputPath(inputPath);
outputPartialTranslOptColl.Add(newTransOpt );