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:
authornicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-27 20:50:52 +0400
committernicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-27 20:50:52 +0400
commit291260abf74ed3fe0c9218465cff6e658d0a1b23 (patch)
tree474b29cf0ba2b37c5ed41b4c805a85121362a3a7 /mert/ScoreArray.h
parent89194be5ebb641072795d9e949312002ac6262e6 (diff)
- made output more compliant with old version
- added PerSCorer.h and BleuScorer.h - stored feature names - fixed bug about output of best Point git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1796 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/ScoreArray.h')
-rw-r--r--mert/ScoreArray.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/mert/ScoreArray.h b/mert/ScoreArray.h
index c9f65d05b..95f6ef749 100644
--- a/mert/ScoreArray.h
+++ b/mert/ScoreArray.h
@@ -27,10 +27,10 @@ using namespace std;
class ScoreArray
{
protected:
- vector<ScoreStats> array_;
+ scorearray_t array_;
private:
- int idx; // idx to identify the utterance, it can differ from the index inside the vector
+ std::string idx; // idx to identify the utterance, it can differ from the index inside the vector
std::string score_type;
public:
@@ -39,29 +39,37 @@ public:
~ScoreArray(){};
inline void clear() { array_.clear(); }
+
+ inline std::string getIndex(){ return idx; }
+ inline void setIndex(const std::string& value){ idx=value; }
- inline size_t getIndex(){ return idx; }
- inline void setIndex(size_t value){ idx=value; }
+// inline ScoreStats get(size_t i){ return array_.at(i); }
+
+ inline ScoreStats& get(size_t i){ return array_.at(i); }
+ inline const ScoreStats& get(size_t i)const{ return array_.at(i); }
- inline ScoreStats get(int i){ return array_.at(i); }
void add(const ScoreStats& e){ array_.push_back(e); }
+ void merge(ScoreArray& e);
+
inline std::string name(){ return score_type; };
inline std::string name(std::string &sctype){ return score_type = sctype; };
inline size_t size(){ return array_.size(); }
+ inline size_t NumberOfScores(){ return (array_.size()>0)?array_.at(0).size():0; }
- void savetxt(ofstream& outFile);
- void savebin(ofstream& outFile);
- void save(ofstream& outFile, bool bin=false);
- void save(const std::string &file, bool bin=false);
- inline void save(bool bin=false){ save("/dev/stdout", bin); }
+ void savetxt(ofstream& outFile, const std::string& sctype);
+ void savebin(ofstream& outFile, const std::string& sctype);
+ void save(ofstream& outFile, const std::string& sctype, bool bin=false);
+ void save(const std::string &file, const std::string& sctype, bool bin=false);
+ inline void save(const std::string& sctype, bool bin=false){ save("/dev/stdout", sctype, bin); }
void loadtxt(ifstream& inFile);
void loadbin(ifstream& inFile);
void load(ifstream& inFile, bool bin=false);
void load(const std::string &file, bool bin=false);
-
+
+ bool check_consistency();
};