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:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-12 05:16:31 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-12 05:16:31 +0400
commit43beb88df52977ed84ced6cb431d21d616fb757a (patch)
treed2ef8904f0429ba74936df7036820b255b007f2f /mert/TerScorer.h
parentfdb83b0f6d7a5b95a4f3c617e5212877d0699eae (diff)
Fix constructors of scorer classes and optimizer classes.
Using public const members is not good idea. It should be initialized in private by constructors.
Diffstat (limited to 'mert/TerScorer.h')
-rw-r--r--mert/TerScorer.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/mert/TerScorer.h b/mert/TerScorer.h
index fada3ba5a..d21e36881 100644
--- a/mert/TerScorer.h
+++ b/mert/TerScorer.h
@@ -29,16 +29,18 @@ using namespace TERCpp;
class TerScorer: public StatisticsBasedScorer
{
public:
- explicit TerScorer(const string& config = "") : StatisticsBasedScorer("TER",config) {}
+ explicit TerScorer(const string& config = "");
+ ~TerScorer();
+
virtual void setReferenceFiles(const vector<string>& referenceFiles);
virtual void prepareStats(size_t sid, const string& text, ScoreStats& entry);
- static const int LENGTH;
+
virtual void whoami() {
cerr << "I AM TerScorer" << std::endl;
}
size_t NumberOfScores() {
// cerr << "TerScorer: " << (LENGTH + 1) << endl;
- return (LENGTH + 1);
+ return (kLENGTH + 1);
}
@@ -47,20 +49,21 @@ public:
// float calculateScore(const vector<float>& comps);
private:
+ const int kLENGTH;
+
string javaEnv;
string tercomEnv;
- // no copying allowed
- TerScorer(const TerScorer&);
- ~TerScorer() {}
- TerScorer& operator=(const TerScorer&);
-
// data extracted from reference files
vector<size_t> _reflengths;
vector<multiset<int> > _reftokens;
vector<vector<int> > m_references;
vector<vector<vector<int> > > m_multi_references;
string m_pid;
+
+ // no copying allowed
+ TerScorer(const TerScorer&);
+ TerScorer& operator=(const TerScorer&);
};
#endif // __TERSCORER_H__