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:
smaj 2010-09-16 20:40:20 +00:00
parent 9b238be7cd
commit 36b6aad53e
3 changed files with 3 additions and 2 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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;