#include <PrefixTreeMap.h>
Public Member Functions | |
PrefixTreeMap () | |
~PrefixTreeMap () | |
void | FreeMemory () |
int | Read (const std::string &fileNameStem, int numVocs=-1) |
void | GetCandidates (const IPhrase &key, Candidates *cands) |
void | GetCandidates (const PPimp &p, Candidates *cands) |
std::vector< std::string const * > | ConvertPhrase (const IPhrase &p, unsigned int voc) const |
IPhrase | ConvertPhrase (const std::vector< std::string > &p, unsigned int voc) const |
LabelId | ConvertWord (const std::string &w, unsigned int voc) const |
std::string | ConvertWord (LabelId w, unsigned int voc) const |
PPimp * | GetRoot () |
PPimp * | Extend (PPimp *p, LabelId wi) |
PPimp * | Extend (PPimp *p, const std::string w, size_t voc) |
Static Public Attributes | |
static const LabelId | MagicWord = std::numeric_limits<LabelId>::max() - 1 |
Definition at line 96 of file PrefixTreeMap.h.
Moses::PrefixTreeMap::PrefixTreeMap | ( | ) | [inline] |
Definition at line 99 of file PrefixTreeMap.h.
References Moses::PrefixTreeF< T, D >::setDefault().
Moses::PrefixTreeMap::~PrefixTreeMap | ( | ) |
Definition at line 68 of file PrefixTreeMap.cpp.
References Moses::fClose(), and FreeMemory().
IPhrase Moses::PrefixTreeMap::ConvertPhrase | ( | const std::vector< std::string > & | p, | |
unsigned int | voc | |||
) | const |
std::vector< std::string const * > Moses::PrefixTreeMap::ConvertPhrase | ( | const IPhrase & | p, | |
unsigned int | voc | |||
) | const |
std::string Moses::PrefixTreeMap::ConvertWord | ( | LabelId | w, | |
unsigned int | voc | |||
) | const |
Definition at line 220 of file PrefixTreeMap.cpp.
References InvalidLabelId, MagicWord, and UTIL_THROW_IF2.
LabelId Moses::PrefixTreeMap::ConvertWord | ( | const std::string & | w, | |
unsigned int | voc | |||
) | const |
Definition at line 213 of file PrefixTreeMap.cpp.
References UTIL_THROW_IF2.
Referenced by Extend().
Definition at line 121 of file PrefixTreeMap.h.
References ConvertWord(), and Extend().
Definition at line 238 of file PrefixTreeMap.cpp.
References ObjectPool< T >::get(), Moses::PrefixTreeF< T, D >::getPtr(), Moses::PPimp::idx, InvalidLabelId, Moses::PPimp::isRoot(), Moses::PPimp::isValid(), NULL, Moses::PPimp::ptr(), and UTIL_THROW_IF2.
Referenced by Extend().
void Moses::PrefixTreeMap::FreeMemory | ( | ) |
Definition at line 80 of file PrefixTreeMap.cpp.
References ObjectPool< T >::reset().
Referenced by ~PrefixTreeMap().
void Moses::PrefixTreeMap::GetCandidates | ( | const PPimp & | p, | |
Candidates * | cands | |||
) |
Definition at line 175 of file PrefixTreeMap.cpp.
References Moses::fSeek(), Moses::PrefixTreeF< T, D >::getData(), Moses::PPimp::idx, Moses::PPimp::isRoot(), Moses::PPimp::isValid(), OFF_T, Moses::PPimp::ptr(), Moses::Candidates::readBin(), and UTIL_THROW_IF2.
void Moses::PrefixTreeMap::GetCandidates | ( | const IPhrase & | key, | |
Candidates * | cands | |||
) |
Definition at line 158 of file PrefixTreeMap.cpp.
References Moses::fSeek(), OFF_T, Moses::Candidates::readBin(), and UTIL_THROW_IF2.
PPimp * Moses::PrefixTreeMap::GetRoot | ( | ) |
Definition at line 233 of file PrefixTreeMap.cpp.
References ObjectPool< T >::get().
int Moses::PrefixTreeMap::Read | ( | const std::string & | fileNameStem, | |
int | numVocs = -1 | |||
) |
Definition at line 108 of file PrefixTreeMap.cpp.
References Moses::fClose(), Moses::FileExists(), Moses::fOpen(), Moses::fReadVector(), Moses::PrefixTreeF< T, D >::getDefault(), Moses::ReadVoc(), and TRACE_ERR.
const LabelId Moses::PrefixTreeMap::MagicWord = std::numeric_limits<LabelId>::max() - 1 [static] |
Definition at line 105 of file PrefixTreeMap.h.
Referenced by ConvertWord(), and Moses::LexicalReorderingTableTree::Create().