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
path: root/moses
diff options
context:
space:
mode:
authorEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-03-15 04:52:35 +0400
committerEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-03-15 04:52:35 +0400
commit1651b552f8005b1b5bfcedfbd9f5cc7a9800de8f (patch)
tree8b605145c5f1806fe08313c46713b06f0c6f046c /moses
parent94fb547b09a191e42e2109c75703afc560a484b8 (diff)
fix bug in last commit
Diffstat (limited to 'moses')
-rw-r--r--moses/src/StaticData.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp
index fc0e32cb4..5a2349979 100644
--- a/moses/src/StaticData.cpp
+++ b/moses/src/StaticData.cpp
@@ -1657,7 +1657,8 @@ bool StaticData::LoadPhraseBoundaryFeature()
//cerr << "source "; for (size_t i = 0; i < sourceFactors.size(); ++i) cerr << sourceFactors[i] << " "; cerr << endl;
//cerr << "target "; for (size_t i = 0; i < targetFactors.size(); ++i) cerr << targetFactors[i] << " "; cerr << endl;
m_phraseBoundaryFeature = new PhraseBoundaryFeature(sourceFactors,targetFactors);
- m_phraseBoundaryFeature->SetSparseProducerWeight(weight[0]);
+ if (weight.size() > 0)
+ m_phraseBoundaryFeature->SetSparseProducerWeight(weight[0]);
return true;
}
@@ -1684,7 +1685,8 @@ bool StaticData::LoadPhrasePairFeature()
size_t sourceFactorId = Scan<FactorType>(tokens[0]);
size_t targetFactorId = Scan<FactorType>(tokens[1]);
m_phrasePairFeature = new PhrasePairFeature(sourceFactorId, targetFactorId);
- m_phrasePairFeature->SetSparseProducerWeight(weight[0]);
+ if (weight.size() > 0)
+ m_phrasePairFeature->SetSparseProducerWeight(weight[0]);
return true;
}
@@ -1818,7 +1820,8 @@ bool StaticData::LoadWordTranslationFeature()
m_wordTranslationFeature = new WordTranslationFeature(factorIdSource, factorIdTarget, simple,
sourceTrigger, targetTrigger);
- m_wordTranslationFeature->SetSparseProducerWeight(weight[0]);
+ if (weight.size() > 0)
+ m_wordTranslationFeature->SetSparseProducerWeight(weight[0]);
// load word list for restricted feature set
if (tokens.size() == 6) {