Data Class Reference

#include <Data.h>

Collaboration diagram for Data:

Collaboration graph

List of all members.

Public Member Functions

 Data (Scorer *scorer)
 Data ()
void clear ()
ScoreDataHandle getScoreData ()
FeatureDataHandle getFeatureData ()
ScorergetScorer ()
std::size_t NumberOfFeatures () const
void NumberOfFeatures (std::size_t v)
std::string Features () const
void Features (const std::string &f)
bool hasSparseFeatures () const
void mergeSparseFeatures ()
void loadNBest (const std::string &file)
void load (const std::string &featfile, const std::string &scorefile)
void save (const std::string &featfile, const std::string &scorefile, bool bin=false)
void removeDuplicates ()
bool existsFeatureNames () const
std::string getFeatureName (std::size_t idx) const
std::size_t getFeatureIndex (const std::string &name) const
void createShards (std::size_t shard_count, float shard_size, const std::string &scorerconfig, std::vector< Data > &shards)
void InitFeatureMap (const std::string &str)
void AddFeatures (const std::string &str, const std::string &sentence_index)

Detailed Description

Definition at line 26 of file Data.h.

Constructor & Destructor Documentation

Data::Data ( Scorer scorer  )  [explicit]

Definition at line 29 of file Data.cpp.

References Scorer::getName(), and TRACE_ERR.

Here is the call graph for this function:

Data::Data (  ) 

Definition at line 22 of file Data.cpp.

Member Function Documentation

void Data::AddFeatures ( const std::string &  str,
const std::string &  sentence_index 

void Data::clear (  )  [inline]

Definition at line 40 of file Data.h.

void Data::createShards ( std::size_t  shard_count,
float  shard_size,
const std::string &  scorerconfig,
std::vector< Data > &  shards 

Create shard_count shards. If shard_size == 0, then the shards are non-overlapping and exhaust the data. If 0 < shard_size <= 1, then shards are chosen by sampling the data (with replacement) and shard_size is interpreted as the proportion of the total size.

bool Data::existsFeatureNames (  )  const [inline]

Definition at line 73 of file Data.h.

void Data::Features ( const std::string &  f  )  [inline]

Definition at line 58 of file Data.h.

std::string Data::Features (  )  const [inline]

Definition at line 57 of file Data.h.

FeatureDataHandle Data::getFeatureData (  )  [inline]

Definition at line 47 of file Data.h.

Referenced by main().

Here is the caller graph for this function:

std::size_t Data::getFeatureIndex ( const std::string &  name  )  const [inline]

Definition at line 81 of file Data.h.

std::string Data::getFeatureName ( std::size_t  idx  )  const [inline]

Definition at line 77 of file Data.h.

ScoreDataHandle Data::getScoreData (  )  [inline]

Definition at line 45 of file Data.h.

Referenced by main().

Here is the caller graph for this function:

Scorer* Data::getScorer (  )  [inline]

Definition at line 49 of file Data.h.

Referenced by main().

Here is the caller graph for this function:

bool Data::hasSparseFeatures (  )  const [inline]

Definition at line 60 of file Data.h.

void Data::InitFeatureMap ( const std::string &  str  ) 

void Data::load ( const std::string &  featfile,
const std::string &  scorefile 

Definition at line 124 of file Data.cpp.

void Data::loadNBest ( const std::string &  file  ) 

void Data::mergeSparseFeatures (  ) 

Definition at line 225 of file Data.cpp.

void Data::NumberOfFeatures ( std::size_t  v  )  [inline]

Definition at line 55 of file Data.h.

std::size_t Data::NumberOfFeatures (  )  const [inline]

Definition at line 51 of file Data.h.

void Data::removeDuplicates (  ) 

void Data::save ( const std::string &  featfile,
const std::string &  scorefile,
bool  bin = false 

Definition at line 162 of file Data.cpp.

The documentation for this class was generated from the following files:

Generated on Sat Jun 30 00:30:11 2012 for Moses by  doxygen 1.5.9