diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-02 18:54:49 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-02 18:54:49 +0400 |
commit | 0596c3e9e47301303c07e1b7d44e671f4c227423 (patch) | |
tree | e81a4df739467c849d60cf8842268b850a63098c /moses/TranslationOptionCollectionConfusionNet.cpp | |
parent | d1d07d5923c03c3c6b7d7ac9cb6745c91f83be08 (diff) |
Add NonTerminalSet variable to InputPath
Diffstat (limited to 'moses/TranslationOptionCollectionConfusionNet.cpp')
-rw-r--r-- | moses/TranslationOptionCollectionConfusionNet.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/moses/TranslationOptionCollectionConfusionNet.cpp b/moses/TranslationOptionCollectionConfusionNet.cpp index b7bbe2a03..5d15ea67a 100644 --- a/moses/TranslationOptionCollectionConfusionNet.cpp +++ b/moses/TranslationOptionCollectionConfusionNet.cpp @@ -33,6 +33,7 @@ TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet InputPathList &list = vec.back(); WordsRange range(startPos, startPos); + const NonTerminalSet &labels = input.GetLabelSet(startPos, startPos); const ConfusionNet::Column &col = input.GetColumn(startPos); for (size_t i = 0; i < col.size(); ++i) { @@ -44,7 +45,7 @@ TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet ScoreComponentCollection *inputScore = new ScoreComponentCollection(); inputScore->Assign(inputFeature, scores); - InputPath *node = new InputPath(subphrase, range, NULL, inputScore); + InputPath *node = new InputPath(subphrase, labels, range, NULL, inputScore); list.push_back(node); m_phraseDictionaryQueue.push_back(node); @@ -55,13 +56,14 @@ TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet for (size_t phaseSize = 2; phaseSize <= size; ++phaseSize) { for (size_t startPos = 0; startPos < size - phaseSize + 1; ++startPos) { size_t endPos = startPos + phaseSize -1; + WordsRange range(startPos, endPos); + const NonTerminalSet &labels = input.GetLabelSet(startPos, endPos); vector<InputPathList> &vec = m_targetPhrasesfromPt[startPos]; vec.push_back(InputPathList()); InputPathList &list = vec.back(); - // loop thru every previous path const InputPathList &prevNodes = GetInputPathList(startPos, endPos - 1); @@ -88,7 +90,7 @@ TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet ScoreComponentCollection *inputScore = new ScoreComponentCollection(*prevInputScore); inputScore->PlusEquals(inputFeature, scores); - InputPath *node = new InputPath(subphrase, range, &prevNode, inputScore); + InputPath *node = new InputPath(subphrase, labels, range, &prevNode, inputScore); list.push_back(node); m_phraseDictionaryQueue.push_back(node); |