mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 19:44:59 +03:00
2ef6f3e2d8
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1692 1f5c12ca-751b-0410-a591-d2e778427230
61 lines
1.0 KiB
C++
61 lines
1.0 KiB
C++
/*
|
|
* Data.h
|
|
* met - Minimum Error Training
|
|
*
|
|
* Created by Nicola Bertoldi on 13/05/08.
|
|
*
|
|
*/
|
|
|
|
#ifndef DATA_H
|
|
#define DATA_H
|
|
|
|
using namespace std;
|
|
|
|
#include <limits>
|
|
#include <vector>
|
|
#include <iostream>
|
|
|
|
#include "Util.h"
|
|
#include "FeatureData.h"
|
|
#include "ScoreData.h"
|
|
|
|
class Scorer;
|
|
|
|
class Data
|
|
{
|
|
protected:
|
|
ScoreData* scoredata;
|
|
FeatureData* featdata;
|
|
vector<int> idxmap_;
|
|
|
|
private:
|
|
char databuf_[BUFSIZ];
|
|
size_t bufLen_;
|
|
Scorer* theScorer;
|
|
std::string score_type;
|
|
|
|
public:
|
|
Data(Scorer& sc);
|
|
|
|
~Data(){};
|
|
|
|
inline void clear() { scoredata->clear(); featdata->clear(); }
|
|
|
|
void loadnbest(const std::string &file);
|
|
|
|
|
|
void load(const std::string &featfile,const std::string &scorefile){
|
|
featdata->load(featfile);
|
|
// scoredata->load(scorefile);
|
|
scoredata->load(scorefile);
|
|
}
|
|
void save(const std::string &featfile,const std::string &scorefile, bool bin=false){
|
|
featdata->save(featfile, bin);
|
|
// scoredata->save(scorefile, bin);
|
|
scoredata->save(scorefile);
|
|
}
|
|
};
|
|
|
|
|
|
#endif
|