diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2017-03-06 15:12:43 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2017-03-06 15:12:43 +0300 |
commit | a4d28de60b8fb50bc48f4b8b8de8a3112f52c109 (patch) | |
tree | a3068863aa809d02dac17e768a8edf930dacaf7c | |
parent | bc3068efcf202d7565b858eb5dfeff70de7ed3ef (diff) |
multiple generation models
-rw-r--r-- | moses/GenerationDictionary.cpp | 9 |
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; |