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/FeatureArray.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/FeatureArray.h')
-rw-r--r--mert/FeatureArray.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/mert/FeatureArray.h b/mert/FeatureArray.h
index 8901d2672..943056bab 100644
--- a/mert/FeatureArray.h
+++ b/mert/FeatureArray.h
@@ -27,10 +27,10 @@ using namespace std;
class FeatureArray
{
protected:
- vector<FeatureStats> array_;
+ featarray_t array_;
private:
- size_t 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
public:
FeatureArray();
@@ -39,17 +39,17 @@ public:
inline void clear() { array_.clear(); }
- inline size_t getIndex(){ return idx; }
- inline void setIndex(size_t value){ idx=value; }
+ inline std::string getIndex(){ return idx; }
+ inline void setIndex(const std::string & value){ idx=value; }
- inline FeatureStats& get(int i){ return array_.at(i); }
- inline const FeatureStats& get(int i)const{ return array_.at(i); }
+ inline FeatureStats& get(size_t i){ return array_.at(i); }
+ inline const FeatureStats& get(size_t i)const{ return array_.at(i); }
void add(FeatureStats e){ array_.push_back(e); }
void merge(FeatureArray& e);
inline size_t size(){ return array_.size(); }
-
+ inline size_t NumberOfFeatures(){ return (array_.size()>0)?array_.at(0).size():0; }
void savetxt(ofstream& outFile);
void savebin(ofstream& outFile);
@@ -62,6 +62,7 @@ public:
void load(ifstream& inFile, bool bin=false);
void load(const std::string &file, bool bin=false);
+ bool check_consistency();
};