Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2016-10-03 19:14:35 +0300
committerHieu Hoang <hieuhoang@gmail.com>2016-10-03 19:14:35 +0300
commit46d459f445f06d7857470184fb32ee99d3cb0264 (patch)
treec13a8339f06b7e04eb33ef08b9d9e23472836a6e
parent4a4bea5b8687b2e7c35ef981154dcbebf1dc2794 (diff)
call CleanUpAfterSentenceProcessing()
-rw-r--r--contrib/moses2/FF/FeatureFunction.h2
-rw-r--r--contrib/moses2/FF/FeatureFunctions.cpp7
-rw-r--r--contrib/moses2/FF/FeatureFunctions.h2
-rw-r--r--contrib/moses2/ManagerBase.cpp2
4 files changed, 12 insertions, 1 deletions
diff --git a/contrib/moses2/FF/FeatureFunction.h b/contrib/moses2/FF/FeatureFunction.h
index 20d8b520d..d38c72b89 100644
--- a/contrib/moses2/FF/FeatureFunction.h
+++ b/contrib/moses2/FF/FeatureFunction.h
@@ -106,7 +106,7 @@ public:
}
// clean up temporary memory, called after processing each sentence
- virtual void CleanUpAfterSentenceProcessing()
+ virtual void CleanUpAfterSentenceProcessing() const
{
}
diff --git a/contrib/moses2/FF/FeatureFunctions.cpp b/contrib/moses2/FF/FeatureFunctions.cpp
index 4eb0d9a3a..53eb0f351 100644
--- a/contrib/moses2/FF/FeatureFunctions.cpp
+++ b/contrib/moses2/FF/FeatureFunctions.cpp
@@ -210,6 +210,13 @@ void FeatureFunctions::EvaluateWhenAppliedBatch(const Batch &batch) const
}
}
+void FeatureFunctions::CleanUpAfterSentenceProcessing() const
+{
+ BOOST_FOREACH(const FeatureFunction *ff, m_featureFunctions) {
+ ff->CleanUpAfterSentenceProcessing();
+ }
+}
+
void FeatureFunctions::ShowWeights(const Weights &allWeights)
{
BOOST_FOREACH(const FeatureFunction *ff, m_featureFunctions) {
diff --git a/contrib/moses2/FF/FeatureFunctions.h b/contrib/moses2/FF/FeatureFunctions.h
index 9d25f1dba..74c77c7e6 100644
--- a/contrib/moses2/FF/FeatureFunctions.h
+++ b/contrib/moses2/FF/FeatureFunctions.h
@@ -81,6 +81,8 @@ public:
void EvaluateWhenAppliedBatch(const Batch &batch) const;
+ void CleanUpAfterSentenceProcessing() const;
+
void ShowWeights(const Weights &allWeights);
protected:
diff --git a/contrib/moses2/ManagerBase.cpp b/contrib/moses2/ManagerBase.cpp
index 6d7dbc6b1..1e774cc5b 100644
--- a/contrib/moses2/ManagerBase.cpp
+++ b/contrib/moses2/ManagerBase.cpp
@@ -34,6 +34,8 @@ ManagerBase::ManagerBase(System &sys, const TranslationTask &task,
ManagerBase::~ManagerBase()
{
+ system.featureFunctions.CleanUpAfterSentenceProcessing();
+
if (m_pool) {
GetPool().Reset();
}