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 <hieuhoang@gmail.com>2017-03-06 15:12:43 +0300
committerHieu Hoang <hieuhoang@gmail.com>2017-03-06 15:12:43 +0300
commita4d28de60b8fb50bc48f4b8b8de8a3112f52c109 (patch)
treea3068863aa809d02dac17e768a8edf930dacaf7c
parentbc3068efcf202d7565b858eb5dfeff70de7ed3ef (diff)
multiple generation models
-rw-r--r--moses/GenerationDictionary.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/moses/GenerationDictionary.cpp b/moses/GenerationDictionary.cpp
index 29a4fa2b3..35546e62c 100644
--- a/moses/GenerationDictionary.cpp
+++ b/moses/GenerationDictionary.cpp
@@ -120,7 +120,14 @@ const OutputWordCollection *GenerationDictionary::FindWord(const Word &word) con
{
const OutputWordCollection *ret;
- Collection::const_iterator iter = m_collection.find(&word);
+ Word wordInput;
+ const std::vector<FactorType> &inputFactors = GetInput();
+ for (size_t i = 0; i < inputFactors.size(); ++i) {
+ FactorType factorType = inputFactors[i];
+ wordInput[factorType] = word[factorType];
+ }
+
+ Collection::const_iterator iter = m_collection.find(&wordInput);
if (iter == m_collection.end()) {
// can't find source phrase
ret = NULL;