diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-14 10:15:30 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-14 10:15:30 +0400 |
commit | 29c16d252a74d7e523f96de7f0d9022ea16c7770 (patch) | |
tree | a0ece729d1b427426c699cb138ad88aa9628c7a1 /mert/ScorerFactory.h | |
parent | be1506e7595bd8602a3aec3469a2407c3453d0b2 (diff) |
Minimize using #include headers in headers.
Should use it in .cpp files.
Diffstat (limited to 'mert/ScorerFactory.h')
-rw-r--r-- | mert/ScorerFactory.h | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/mert/ScorerFactory.h b/mert/ScorerFactory.h index 3a1da4783..f6054c770 100644 --- a/mert/ScorerFactory.h +++ b/mert/ScorerFactory.h @@ -1,53 +1,17 @@ #ifndef __SCORER_FACTORY_H #define __SCORER_FACTORY_H -#include <algorithm> -#include <cmath> -#include <iostream> -#include <iterator> -#include <set> -#include <sstream> -#include <stdexcept> -#include <string> #include <vector> -#include "Types.h" -#include "Scorer.h" -#include "BleuScorer.h" -#include "PerScorer.h" -#include "TerScorer.h" -#include "CderScorer.h" -#include "MergeScorer.h" +#include <string> -using namespace std; +class Scorer; class ScorerFactory { public: - static vector<string> getTypes() { - vector<string> types; - types.push_back(string("BLEU")); - types.push_back(string("PER")); - types.push_back(string("TER")); - types.push_back(string("CDER")); - types.push_back(string("MERGE")); - return types; - } + static std::vector<std::string> getTypes(); - static Scorer* getScorer(const string& type, const string& config = "") { - if (type == "BLEU") { - return (BleuScorer*) new BleuScorer(config); - } else if (type == "PER") { - return (PerScorer*) new PerScorer(config); - } else if (type == "TER") { - return (TerScorer*) new TerScorer(config); - } else if (type == "CDER") { - return (CderScorer*) new CderScorer(config); - } else if (type == "MERGE") { - return (MergeScorer*) new MergeScorer(config); - } else { - throw runtime_error("Unknown scorer type: " + type); - } - } + static Scorer* getScorer(const std::string& type, const std::string& config = ""); private: ScorerFactory() {} |