mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-02 17:09:36 +03:00
delete cache
This commit is contained in:
parent
587c1a9f54
commit
bd5d308bf2
@ -101,14 +101,14 @@ void KENLM::Load(System &system)
|
||||
|
||||
void KENLM::InitializeForInput(const Manager &mgr) const
|
||||
{
|
||||
CacheColl &cache = GetCache();
|
||||
cache.clear();
|
||||
mgr.lmCache = &cache;
|
||||
mgr.lmCache = new CacheColl();
|
||||
}
|
||||
|
||||
// clean up temporary memory, called after processing each sentence
|
||||
void KENLM::CleanUpAfterSentenceProcessing(const Manager &mgr) const
|
||||
{
|
||||
CacheColl *lmCache = (CacheColl*)mgr.lmCache;
|
||||
delete lmCache;
|
||||
}
|
||||
|
||||
void KENLM::SetParameter(const std::string& key, const std::string& value)
|
||||
@ -340,10 +340,5 @@ const KENLM::LMCacheValue &KENLM::ScoreAndCache(const Manager &mgr, const lm::ng
|
||||
return *val;
|
||||
}
|
||||
|
||||
KENLM::CacheColl &KENLM::GetCache() const
|
||||
{
|
||||
return GetThreadSpecificObj(m_cache);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -96,9 +96,6 @@ protected:
|
||||
lm::WordIndex *LastIDs(const Hypothesis &hypo, lm::WordIndex *indices) const;
|
||||
|
||||
const LMCacheValue &ScoreAndCache(const Manager &mgr, const lm::ngram::State &in_state, const lm::WordIndex new_word) const;
|
||||
|
||||
CacheColl &GetCache() const;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user