diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-09 21:49:31 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-09 21:49:31 +0400 |
commit | ed6e6f00b1b73a99d9177b984835af063ccf690f (patch) | |
tree | 4c056061a9c32f6aca3c7e7869c0fe602302b066 /mert/BleuScorer.h | |
parent | 127f958bed67715630e5939826549af5015a9b13 (diff) |
Minor change for calculating BLEU.
To avoid defining the similar variables twice to calculate
document-wise BLEU and sentence-wise BLEU scores.
Diffstat (limited to 'mert/BleuScorer.h')
-rw-r--r-- | mert/BleuScorer.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mert/BleuScorer.h b/mert/BleuScorer.h index 7ae19fa5f..f3513e135 100644 --- a/mert/BleuScorer.h +++ b/mert/BleuScorer.h @@ -12,6 +12,8 @@ using namespace std; +const int kBleuNgramOrder = 4; + /** * Bleu scoring */ @@ -24,7 +26,7 @@ public: virtual void setReferenceFiles(const vector<string>& referenceFiles); virtual void prepareStats(size_t sid, const string& text, ScoreStats& entry); virtual float calculateScore(const vector<int>& comps) const; - virtual size_t NumberOfScores() const { return 2 * kLENGTH + 1; } + virtual size_t NumberOfScores() const { return 2 * kBleuNgramOrder + 1; } private: enum ReferenceLengthType { @@ -55,7 +57,6 @@ private: void CalcShortest(size_t sentence_id, vector<ScoreStatsType>& stats) const; - const int kLENGTH; ReferenceLengthType m_ref_length_type; // data extracted from reference files |