mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 07:42:21 +03:00
Calling of InitFeatureNames moved.
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/branches/mira-mtm5@3496 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
9b238be7cd
commit
36b6aad53e
@ -65,6 +65,7 @@ PhraseDictionaryFeature::PhraseDictionaryFeature
|
||||
{
|
||||
const StaticData& staticData = StaticData::Instance();
|
||||
const_cast<ScoreIndexManager&>(staticData.GetScoreIndexManager()).AddScoreProducer(this);
|
||||
const_cast<ScoreIndexManager&>(staticData.GetScoreIndexManager()).InitFeatureNames();
|
||||
if (implementation == Memory || implementation == SCFG || implementation == OnDisk || implementation == SuffixArray) {
|
||||
m_useThreadSafePhraseDictionary = true;
|
||||
} else {
|
||||
|
@ -28,7 +28,6 @@ void ScoreIndexManager::AddScoreProducer(const ScoreProducer* sp)
|
||||
assert(numScoreCompsProduced > 0);
|
||||
m_last += numScoreCompsProduced;
|
||||
m_ends.push_back(m_last);
|
||||
InitFeatureNames();
|
||||
/*VERBOSE(1,"Added ScoreProducer(" << sp->GetScoreBookkeepingID()
|
||||
<< " " << sp->GetScoreProducerDescription()
|
||||
<< ") index=" << m_begins.back() << "-" << m_ends.back()-1 << std::endl);
|
||||
@ -68,7 +67,7 @@ void ScoreIndexManager::InitFeatureNames() {
|
||||
vector<const ScoreProducer *>::const_iterator it;
|
||||
for (it = m_producers.begin(); it != m_producers.end(); ++it) {
|
||||
ostringstream oStream;
|
||||
oStream << /* (*it)->GetScoreProducerDescription() << "_" << */ globalIndex;
|
||||
oStream << (*it)->GetScoreProducerDescription() << "_" << globalIndex;
|
||||
m_featureNames.push_back(oStream.str());
|
||||
m_featureIndexes[oStream.str()] = globalIndex;
|
||||
++globalIndex;
|
||||
|
@ -783,6 +783,7 @@ bool StaticData::LoadLanguageModels()
|
||||
m_languageModel.Add(lm);
|
||||
}
|
||||
}
|
||||
m_scoreIndexManager.InitFeatureNames();
|
||||
// flag indicating that language models were loaded,
|
||||
// since phrase table loading requires their presence
|
||||
m_fLMsLoaded = true;
|
||||
|
Loading…
Reference in New Issue
Block a user