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>2012-03-19 17:45:15 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-03-19 17:45:15 +0400
commitf686e8771a5db09e32474ed0735dbdef275158d3 (patch)
treeb61c91008d5fb45b3e569da7f22063b549417372 /mert/BleuScorer.h
parent54233d327052793807fc44583334dd3b396176e5 (diff)
Add some functions to BleuScorer for unit testing.
This commit also includes - Fix typo. - Fix indentations. - Add 'const' to Scorer::applyFactors().
Diffstat (limited to 'mert/BleuScorer.h')
-rw-r--r--mert/BleuScorer.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/mert/BleuScorer.h b/mert/BleuScorer.h
index d58277a41..2f2c2a153 100644
--- a/mert/BleuScorer.h
+++ b/mert/BleuScorer.h
@@ -23,6 +23,12 @@ class Reference;
class BleuScorer: public StatisticsBasedScorer
{
public:
+ enum ReferenceLengthType {
+ AVERAGE,
+ CLOSEST,
+ SHORTEST
+ };
+
explicit BleuScorer(const string& config = "");
~BleuScorer();
@@ -33,20 +39,19 @@ public:
int CalcReferenceLength(size_t sentence_id, size_t length);
-private:
- enum ReferenceLengthType {
- AVERAGE,
- SHORTEST,
- CLOSEST
- };
+ ReferenceLengthType GetReferenceLengthType() const { return m_ref_length_type; }
+ void SetReferenceLengthType(ReferenceLengthType type) { m_ref_length_type = type; }
+
+ const std::vector<Reference*>& GetReferences() const { return m_references.get(); }
/**
* Count the ngrams of each type, up to the given length in the input line.
*/
- size_t countNgrams(const string& line, NgramCounts& counts, unsigned int n);
+ size_t CountNgrams(const string& line, NgramCounts& counts, unsigned int n);
- void dump_counts(std::ostream* os, const NgramCounts& counts) const;
+ void DumpCounts(std::ostream* os, const NgramCounts& counts) const;
+private:
ReferenceLengthType m_ref_length_type;
// reference translations.