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:
authorMatthias Huck <mhuck@inf.ed.ac.uk>2015-04-30 21:44:29 +0300
committerMatthias Huck <mhuck@inf.ed.ac.uk>2015-04-30 21:44:29 +0300
commit34d1d3a9043d0bfa1e32dc0e5fc8b919fadf2bf1 (patch)
tree3c3aadcd860e6af20280054ae062357843691396 /mert/BleuScorer.h
parente98a2fc980b995c4422615f22126816a93326d20 (diff)
sentence-bleu-nbest
Diffstat (limited to 'mert/BleuScorer.h')
-rw-r--r--mert/BleuScorer.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/mert/BleuScorer.h b/mert/BleuScorer.h
index 0594c8dca..e90915822 100644
--- a/mert/BleuScorer.h
+++ b/mert/BleuScorer.h
@@ -42,11 +42,14 @@ public:
return 2 * kBleuNgramOrder + 1;
}
- int CalcReferenceLength(std::size_t sentence_id, std::size_t length);
+ void CalcBleuStats(const Reference* ref, const std::string& text, ScoreStats& entry) const;
+
+ int CalcReferenceLength(const Reference* ref, std::size_t length) const;
ReferenceLengthType GetReferenceLengthType() const {
return m_ref_length_type;
}
+
void SetReferenceLengthType(ReferenceLengthType type) {
m_ref_length_type = type;
}
@@ -62,14 +65,14 @@ public:
/**
* Count the ngrams of each type, up to the given length in the input line.
*/
- std::size_t CountNgrams(const std::string& line, NgramCounts& counts, unsigned int n, bool is_testing=false);
+ std::size_t CountNgrams(const std::string& line, NgramCounts& counts, unsigned int n, bool is_testing=false) const;
void DumpCounts(std::ostream* os, const NgramCounts& counts) const;
- bool OpenReference(const char* filename, std::size_t file_id);
-
// NOTE: this function is used for unit testing.
- virtual bool OpenReferenceStream(std::istream* is, std::size_t file_id);
+ bool OpenReferenceStream(std::istream* is, std::size_t file_id);
+
+ void ProcessReferenceLine(const std::string& line, Reference* ref) const;
//private:
protected: