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 22:44:52 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-08-13 22:44:52 +0400
commit563cdc527a814fd6cf7ffae0c7a5fd86999e0a7a (patch)
tree4a690b3cfdc825cea603d8687e9d67f7ec4ab8cc /moses/TranslationOptionCollectionConfusionNet.cpp
parent0d60b7f2ddcfd4be0a74e112eba7d2a2b96dee58 (diff)
use input path for unknown word processing in phrase-based
Diffstat (limited to 'moses/TranslationOptionCollectionConfusionNet.cpp')
-rw-r--r--moses/TranslationOptionCollectionConfusionNet.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/moses/TranslationOptionCollectionConfusionNet.cpp b/moses/TranslationOptionCollectionConfusionNet.cpp
index 8131c9482..e2625ce1f 100644
--- a/moses/TranslationOptionCollectionConfusionNet.cpp
+++ b/moses/TranslationOptionCollectionConfusionNet.cpp
@@ -123,9 +123,18 @@ void TranslationOptionCollectionConfusionNet::ProcessUnknownWord(size_t sourcePo
ConfusionNet const& source=dynamic_cast<ConfusionNet const&>(m_source);
ConfusionNet::Column const& coll=source.GetColumn(sourcePos);
+ const InputPathList &inputPathList = GetInputPathList(sourcePos, sourcePos);
+
+ ConfusionNet::Column::const_iterator iterCol;
+ InputPathList::const_iterator iterInputPath;
size_t j=0;
- for(ConfusionNet::Column::const_iterator i=coll.begin(); i!=coll.end(); ++i) {
- ProcessOneUnknownWord(i->first ,sourcePos, source.GetColumnIncrement(sourcePos, j++),&(i->second));
+ for(iterCol = coll.begin(), iterInputPath = inputPathList.begin();
+ iterCol != coll.end();
+ ++iterCol , ++iterInputPath) {
+ const InputPath &inputPath = **iterInputPath;
+ size_t length = source.GetColumnIncrement(sourcePos, j++);
+ const Scores &inputScores = iterCol->second;
+ ProcessOneUnknownWord(inputPath ,sourcePos, length, &inputScores);
}
}