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-05-10 02:51:05 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-05-10 02:51:05 +0400
commit9c9d88a78a13d7bd5ad4f10b06c355519e4e41ad (patch)
tree7961401877857cf42849916ef7aaba8258a1bc55 /mert/BleuScorer.h
parentaa269bdb4d82207d1381069c256745780f7cd798 (diff)
Avoid "using namespace std" in headers.
Diffstat (limited to 'mert/BleuScorer.h')
-rw-r--r--mert/BleuScorer.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/mert/BleuScorer.h b/mert/BleuScorer.h
index b6503ba9b..1f568f744 100644
--- a/mert/BleuScorer.h
+++ b/mert/BleuScorer.h
@@ -10,8 +10,6 @@
#include "Scorer.h"
#include "ScopedVector.h"
-using namespace std;
-
const int kBleuNgramOrder = 4;
class NgramCounts;
@@ -29,15 +27,15 @@ public:
SHORTEST
};
- explicit BleuScorer(const string& config = "");
+ explicit BleuScorer(const std::string& config = "");
~BleuScorer();
- 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 * kBleuNgramOrder + 1; }
+ virtual void setReferenceFiles(const std::vector<std::string>& referenceFiles);
+ virtual void prepareStats(std::size_t sid, const std::string& text, ScoreStats& entry);
+ virtual float calculateScore(const std::vector<int>& comps) const;
+ virtual std::size_t NumberOfScores() const { return 2 * kBleuNgramOrder + 1; }
- int CalcReferenceLength(size_t sentence_id, size_t length);
+ int CalcReferenceLength(std::size_t sentence_id, std::size_t length);
ReferenceLengthType GetReferenceLengthType() const { return m_ref_length_type; }
void SetReferenceLengthType(ReferenceLengthType type) { m_ref_length_type = type; }
@@ -47,14 +45,14 @@ public:
/**
* 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);
+ std::size_t CountNgrams(const std::string& line, NgramCounts& counts, unsigned int n);
void DumpCounts(std::ostream* os, const NgramCounts& counts) const;
- bool OpenReference(const char* filename, size_t file_id);
+ bool OpenReference(const char* filename, std::size_t file_id);
// NOTE: this function is used for unit testing.
- bool OpenReferenceStream(std::istream* is, size_t file_id);
+ bool OpenReferenceStream(std::istream* is, std::size_t file_id);
private:
ReferenceLengthType m_ref_length_type;
@@ -70,6 +68,6 @@ private:
/** Computes sentence-level BLEU+1 score.
* This function is used in PRO.
*/
-float sentenceLevelBleuPlusOne(const vector<float>& stats);
+float sentenceLevelBleuPlusOne(const std::vector<float>& stats);
#endif // MERT_BLEU_SCORER_H_