diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-11 15:40:59 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-11 15:40:59 +0400 |
commit | c2121695c2a7be7538745759f2f86ec280baa54d (patch) | |
tree | e1e30e8a573890f8c380e6c49f7ada43c7359148 /mert/ScorerFactory.h | |
parent | 85d39d7d428a2ae1fbf4ee08c1146181b87b5d9d (diff) |
Fix memory leaks in mert.
Diffstat (limited to 'mert/ScorerFactory.h')
-rw-r--r-- | mert/ScorerFactory.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mert/ScorerFactory.h b/mert/ScorerFactory.h index 9bab8d933..18963b529 100644 --- a/mert/ScorerFactory.h +++ b/mert/ScorerFactory.h @@ -22,9 +22,8 @@ using namespace std; class ScorerFactory { - public: - vector<string> getTypes() { + static vector<string> getTypes() { vector<string> types; types.push_back(string("BLEU")); types.push_back(string("PER")); @@ -34,7 +33,7 @@ public: return types; } - Scorer* getScorer(const string& type, const string& config = "") { + static Scorer* getScorer(const string& type, const string& config = "") { if (type == "BLEU") { return (BleuScorer*) new BleuScorer(config); } else if (type == "PER") { @@ -49,6 +48,10 @@ public: throw runtime_error("Unknown scorer type: " + type); } } + +private: + ScorerFactory() {} + ~ScorerFactory() {} }; #endif //__SCORER_FACTORY_H |