diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-19 18:21:02 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-19 18:21:02 +0400 |
commit | 2b28072f7a9e651a0e87fb84ec5c8956e2bbed47 (patch) | |
tree | 32ba4ea5b0f6d4f8fd260a6489d549a7ad20a28a /mert/BleuScorer.cpp | |
parent | f686e8771a5db09e32474ed0735dbdef275158d3 (diff) |
Move Encoder class from Scorer.h to Ngram.h.
To add unit tests.
Diffstat (limited to 'mert/BleuScorer.cpp')
-rw-r--r-- | mert/BleuScorer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mert/BleuScorer.cpp b/mert/BleuScorer.cpp index 5862dd3e1..1eb4c274e 100644 --- a/mert/BleuScorer.cpp +++ b/mert/BleuScorer.cpp @@ -54,7 +54,7 @@ size_t BleuScorer::CountNgrams(const string& line, NgramCounts& counts, for (size_t j = i; j < i+k && j < encoded_tokens.size(); ++j) { ngram.push_back(encoded_tokens[j]); } - counts.add(ngram); + counts.Add(ngram); } } return encoded_tokens.size(); @@ -93,7 +93,7 @@ void BleuScorer::setReferenceFiles(const vector<string>& referenceFiles) const NgramCounts::Value newcount = ci->second; NgramCounts::Value oldcount = 0; - m_references[sid]->get_counts()->lookup(ngram, &oldcount); + m_references[sid]->get_counts()->Lookup(ngram, &oldcount); if (newcount > oldcount) { m_references[sid]->get_counts()->operator[](ngram) = newcount; } @@ -133,7 +133,7 @@ void BleuScorer::prepareStats(size_t sid, const string& text, ScoreStats& entry) NgramCounts::Value correct = 0; NgramCounts::Value v = 0; - if (m_references[sid]->get_counts()->lookup(testcounts_it->first, &v)) { + if (m_references[sid]->get_counts()->Lookup(testcounts_it->first, &v)) { correct = min(v, guess); } stats[len * 2 - 2] += correct; |