From 961cc53ae5280505af842ec551cba425a024c492 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Mon, 24 Dec 2012 14:34:34 +0000 Subject: [PATCH] clean up CleanUpAfterSentenceProcessing() --- moses/LM/LDHT.cpp | 4 ++-- moses/TranslationModel/BilingualDynSuffixArray.cpp | 5 ----- moses/TranslationModel/BilingualDynSuffixArray.h | 1 - moses/TranslationModel/PhraseDictionaryDynSuffixArray.cpp | 5 ----- moses/TranslationModel/PhraseDictionaryDynSuffixArray.h | 1 - moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp | 6 ------ moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h | 1 - moses/TranslationModel/RuleTable/Trie.cpp | 5 ----- moses/TranslationModel/RuleTable/Trie.h | 2 -- 9 files changed, 2 insertions(+), 28 deletions(-) diff --git a/moses/LM/LDHT.cpp b/moses/LM/LDHT.cpp index 04725c025..0b87eb3b6 100644 --- a/moses/LM/LDHT.cpp +++ b/moses/LM/LDHT.cpp @@ -76,7 +76,7 @@ public: virtual LanguageModel* Duplicate( ScoreIndexManager& scoreIndexManager) const; virtual void InitializeBeforeSentenceProcessing(); - virtual void CleanUpAfterSentenceProcessing(); + virtual void CleanUpAfterSentenceProcessing(const InputType &source); virtual const FFState* EmptyHypothesisState(const InputType& input) const; virtual bool Useable(const Phrase& phrase) const; virtual void CalcScore(const Phrase& phrase, @@ -184,7 +184,7 @@ void LanguageModelLDHT::InitializeBeforeSentenceProcessing() { m_start_tick = LDHT::Util::rdtsc(); } -void LanguageModelLDHT::CleanUpAfterSentenceProcessing() { +void LanguageModelLDHT::CleanUpAfterSentenceProcessing(const InputType &source) { LDHT::Client* client = getClientSafe(); std::cerr << "LDHT sentence stats:" << std::endl; diff --git a/moses/TranslationModel/BilingualDynSuffixArray.cpp b/moses/TranslationModel/BilingualDynSuffixArray.cpp index 0d90067c6..6e774edfc 100644 --- a/moses/TranslationModel/BilingualDynSuffixArray.cpp +++ b/moses/TranslationModel/BilingualDynSuffixArray.cpp @@ -214,11 +214,6 @@ bool BilingualDynSuffixArray::ExtractPhrases(const int& sntIndex, const int& wor return curSnt.Extract(m_maxPhraseLength, phrasePairs, leftIdx, rightIdx); // extract all phrase Alignments in sentence } -void BilingualDynSuffixArray::CleanUp(const InputType& source) -{ - //m_wordPairCache.clear(); -} - int BilingualDynSuffixArray::LoadCorpus(InputFileStream& corpus, const FactorList& factors, std::vector& cArray, std::vector& sntArray, Vocab* vocab) diff --git a/moses/TranslationModel/BilingualDynSuffixArray.h b/moses/TranslationModel/BilingualDynSuffixArray.h index bbf238114..c684a534e 100644 --- a/moses/TranslationModel/BilingualDynSuffixArray.h +++ b/moses/TranslationModel/BilingualDynSuffixArray.h @@ -98,7 +98,6 @@ public: std::string source, std::string target, std::string alignments, const std::vector &weight); void GetTargetPhrasesByLexicalWeight(const Phrase& src, std::vector< std::pair >& target) const; - void CleanUp(const InputType& source); void addSntPair(string& source, string& target, string& alignment); private: DynSuffixArray* m_srcSA; diff --git a/moses/TranslationModel/PhraseDictionaryDynSuffixArray.cpp b/moses/TranslationModel/PhraseDictionaryDynSuffixArray.cpp index 82f7b1936..47edd43a8 100644 --- a/moses/TranslationModel/PhraseDictionaryDynSuffixArray.cpp +++ b/moses/TranslationModel/PhraseDictionaryDynSuffixArray.cpp @@ -43,11 +43,6 @@ void PhraseDictionaryDynSuffixArray::InitializeForInput(const InputType& input) CHECK(&input == &input); } -void PhraseDictionaryDynSuffixArray::CleanUp(const InputType &source) -{ - m_biSA->CleanUp(source); -} - const TargetPhraseCollection *PhraseDictionaryDynSuffixArray::GetTargetPhraseCollection(const Phrase& src) const { TargetPhraseCollection *ret = new TargetPhraseCollection(); diff --git a/moses/TranslationModel/PhraseDictionaryDynSuffixArray.h b/moses/TranslationModel/PhraseDictionaryDynSuffixArray.h index 25d8d6eb1..8fa2dd0fe 100644 --- a/moses/TranslationModel/PhraseDictionaryDynSuffixArray.h +++ b/moses/TranslationModel/PhraseDictionaryDynSuffixArray.h @@ -29,7 +29,6 @@ public: // functions below required by base class const TargetPhraseCollection* GetTargetPhraseCollection(const Phrase& src) const; void InitializeForInput(const InputType& i); - void CleanUp(const InputType &source); void insertSnt(string&, string&, string&); void deleteSnt(unsigned, unsigned); ChartRuleLookupManager *CreateRuleLookupManager(const InputType&, const ChartCellCollectionBase&); diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp index fb8177ffe..8250984cb 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp @@ -32,7 +32,6 @@ namespace Moses { PhraseDictionaryOnDisk::~PhraseDictionaryOnDisk() { - CleanUp(); } bool PhraseDictionaryOnDisk::Load(const std::vector &input @@ -79,11 +78,6 @@ void PhraseDictionaryOnDisk::InitializeForInput(const InputType& /* input */) // Nothing to do: sentence-specific state is stored in ChartRuleLookupManager } -void PhraseDictionaryOnDisk::CleanUp() -{ - // Nothing to do: sentence-specific state is stored in ChartRuleLookupManager -} - void PhraseDictionaryOnDisk::LoadTargetLookup() { // TODO diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h index 3ed94d2c4..61f2b41a3 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h @@ -74,7 +74,6 @@ public: virtual const TargetPhraseCollection *GetTargetPhraseCollection(const Phrase& src) const; void InitializeForInput(const InputType& input); - void CleanUp(); virtual ChartRuleLookupManager *CreateRuleLookupManager( const InputType &, diff --git a/moses/TranslationModel/RuleTable/Trie.cpp b/moses/TranslationModel/RuleTable/Trie.cpp index fde9301b4..5abba5f7b 100644 --- a/moses/TranslationModel/RuleTable/Trie.cpp +++ b/moses/TranslationModel/RuleTable/Trie.cpp @@ -28,7 +28,6 @@ namespace Moses RuleTableTrie::~RuleTableTrie() { - CleanUp(); } bool RuleTableTrie::Load(const std::vector &input, @@ -58,9 +57,5 @@ void RuleTableTrie::InitializeForInput(const InputType& /* input */) // Nothing to do: sentence-specific state is stored in ChartRuleLookupManager } -void RuleTableTrie::CleanUp() -{ - // Nothing to do: sentence-specific state is stored in ChartRuleLookupManager -} } // namespace Moses diff --git a/moses/TranslationModel/RuleTable/Trie.h b/moses/TranslationModel/RuleTable/Trie.h index 0d8f0a735..c36195f49 100644 --- a/moses/TranslationModel/RuleTable/Trie.h +++ b/moses/TranslationModel/RuleTable/Trie.h @@ -67,8 +67,6 @@ class RuleTableTrie : public PhraseDictionary virtual void InitializeForInput(const InputType& i); - void CleanUp(); - private: friend class RuleTableLoader;