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-02 18:54:49 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-08-02 18:54:49 +0400
commit0596c3e9e47301303c07e1b7d44e671f4c227423 (patch)
treee81a4df739467c849d60cf8842268b850a63098c /moses/TranslationOptionCollectionConfusionNet.cpp
parentd1d07d5923c03c3c6b7d7ac9cb6745c91f83be08 (diff)
Add NonTerminalSet variable to InputPath
Diffstat (limited to 'moses/TranslationOptionCollectionConfusionNet.cpp')
-rw-r--r--moses/TranslationOptionCollectionConfusionNet.cpp8
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);