#include <pcfg.h>
Public Types | |
typedef std::vector< std::size_t > | Key |
typedef std::map< Key, double > | Map |
typedef Map::iterator | iterator |
typedef Map::const_iterator | const_iterator |
Public Member Functions | |
Pcfg () | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | Add (const Key &, double) |
bool | Lookup (const Key &, double &) const |
void | Read (std::istream &, Vocabulary &) |
void | Write (const Vocabulary &, std::ostream &) const |
Definition at line 36 of file pcfg.h.
typedef Map::const_iterator Moses::PCFG::Pcfg::const_iterator |
typedef Map::iterator Moses::PCFG::Pcfg::iterator |
typedef std::vector<std::size_t> Moses::PCFG::Pcfg::Key |
typedef std::map<Key, double> Moses::PCFG::Pcfg::Map |
void Moses::PCFG::Pcfg::Add | ( | const Key & | key, | |
double | score | |||
) |
Definition at line 32 of file pcfg.cc.
Referenced by Moses::PCFG::RuleCollection::CreatePcfg(), and Read().
const_iterator Moses::PCFG::Pcfg::begin | ( | ) | const [inline] |
iterator Moses::PCFG::Pcfg::begin | ( | ) | [inline] |
const_iterator Moses::PCFG::Pcfg::end | ( | ) | const [inline] |
iterator Moses::PCFG::Pcfg::end | ( | ) | [inline] |
bool Moses::PCFG::Pcfg::Lookup | ( | const Key & | key, | |
double & | score | |||
) | const |
Definition at line 36 of file pcfg.cc.
Referenced by Moses::PCFG::TreeScorer::Score().
void Moses::PCFG::Pcfg::Read | ( | std::istream & | input, | |
Vocabulary & | vocab | |||
) |
Definition at line 45 of file pcfg.cc.
References Add(), begin(), Moses::PCFG::NumberedSet< T, I >::Insert(), key, line, MosesTuning::split(), and trim().
Referenced by Moses::PCFG::PcfgScore::Main().
void Moses::PCFG::Pcfg::Write | ( | const Vocabulary & | vocab, | |
std::ostream & | output | |||
) | const |
Definition at line 91 of file pcfg.cc.
References begin(), end(), key, and Moses::PCFG::NumberedSet< T, I >::Lookup().
Referenced by Moses::PCFG::PcfgExtract::Main().