diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-07-10 22:44:38 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-07-10 22:44:38 +0400 |
commit | 475ebd2bbbc81651a3137420bd0c7b181fe4d61a (patch) | |
tree | efb953b566913c2ac3260a19082a162ee4995cdb /moses/TranslationOptionCollectionText.cpp | |
parent | 3c343b7cc57cc6f77630b17d67f7c687d86b09eb (diff) |
get rid of translation option cache
Diffstat (limited to 'moses/TranslationOptionCollectionText.cpp')
-rw-r--r-- | moses/TranslationOptionCollectionText.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/moses/TranslationOptionCollectionText.cpp b/moses/TranslationOptionCollectionText.cpp index 61e51efe3..4937f58a9 100644 --- a/moses/TranslationOptionCollectionText.cpp +++ b/moses/TranslationOptionCollectionText.cpp @@ -129,26 +129,6 @@ void TranslationOptionCollectionText::CreateTranslationOptionsForRange( if ((StaticData::Instance().GetXmlInputType() != XmlExclusive) || !HasXmlOptionsOverlappingRange(startPos,endPos)) { Phrase *sourcePhrase = NULL; // can't initialise with substring, in case it's confusion network - // consult persistent (cross-sentence) cache for stored translation options - bool skipTransOptCreation = false - , useCache = StaticData::Instance().GetUseTransOptCache(); - if (useCache) { - const WordsRange wordsRange(startPos, endPos); - sourcePhrase = new Phrase(m_source.GetSubString(wordsRange)); - - const TranslationOptionList *transOptList = StaticData::Instance().FindTransOptListInCache(decodeGraph, *sourcePhrase); - // is phrase in cache? - if (transOptList != NULL) { - skipTransOptCreation = true; - TranslationOptionList::const_iterator iterTransOpt; - for (iterTransOpt = transOptList->begin() ; iterTransOpt != transOptList->end() ; ++iterTransOpt) { - TranslationOption *transOpt = new TranslationOption(**iterTransOpt, wordsRange); - Add(transOpt); - } - } - } // useCache - - if (!skipTransOptCreation) { // partial trans opt stored in here PartialTranslOptColl* oldPtoc = new PartialTranslOptColl; size_t totalEarlyPruned = 0; @@ -216,22 +196,10 @@ void TranslationOptionCollectionText::CreateTranslationOptionsForRange( Add(transOpt); } - // storing translation options in persistent cache (kept across sentences) - if (useCache) { - if (partTransOptList.size() > 0) { - TranslationOptionList &transOptList = GetTranslationOptionList(startPos, endPos); - StaticData::Instance().AddTransOptListToCache(decodeGraph, *sourcePhrase, transOptList); - } - } - lastPartialTranslOptColl.DetachAll(); totalEarlyPruned += oldPtoc->GetPrunedCount(); delete oldPtoc; // TRACE_ERR( "Early translation options pruned: " << totalEarlyPruned << endl); - } // if (!skipTransOptCreation) - - if (useCache) - delete sourcePhrase; } // if ((StaticData::Instance().GetXmlInputType() != XmlExclusive) || !HasXmlOptionsOverlappingRange(startPos,endPos)) if (graphInd == 0 && StaticData::Instance().GetXmlInputType() != XmlPassThrough && HasXmlOptionsOverlappingRange(startPos,endPos)) { |