From dfb714296fcb6ee2bdde028a5c5bef430b9558aa Mon Sep 17 00:00:00 2001 From: Tetsuo Kiso Date: Sat, 12 Nov 2011 09:51:27 +0900 Subject: Add 'explicit' for constructors with one argument. --- mert/BleuScorer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mert/BleuScorer.h') diff --git a/mert/BleuScorer.h b/mert/BleuScorer.h index 373325744..500910bb0 100644 --- a/mert/BleuScorer.h +++ b/mert/BleuScorer.h @@ -27,7 +27,7 @@ enum BleuReferenceLengthStrategy { BLEU_AVERAGE, BLEU_SHORTEST, BLEU_CLOSEST }; class BleuScorer: public StatisticsBasedScorer { public: - BleuScorer(const string& config = "") : StatisticsBasedScorer("BLEU",config),_refLengthStrategy(BLEU_CLOSEST) { + explicit BleuScorer(const string& config = "") : StatisticsBasedScorer("BLEU",config),_refLengthStrategy(BLEU_CLOSEST) { //configure regularisation static string KEY_REFLEN = "reflen"; static string REFLEN_AVERAGE = "average"; @@ -61,10 +61,11 @@ public: float calculateScore(const vector& comps); private: - //no copy + // no copying allowed BleuScorer(const BleuScorer&); ~BleuScorer() {} BleuScorer& operator=(const BleuScorer&); + //Used to construct the ngram map struct CompareNgrams { int operator() (const vector& a, const vector& b) { -- cgit v1.2.3