#include <Model1Feature.h>
Public Member Functions | |
Model1Vocabulary () | |
bool | Store (const Factor *word, const unsigned id) |
unsigned | StoreIfNew (const Factor *word) |
unsigned | GetWordID (const Factor *word) const |
const Factor * | GetWord (unsigned id) const |
void | Load (const std::string &fileName) |
Static Public Attributes | |
static const std::string | GIZANULL = "GIZANULL" |
Protected Attributes | |
boost::unordered_map< const Factor *, unsigned > | m_lookup |
std::vector< const Factor * > | m_vocab |
const Factor * | m_NULL |
Definition at line 17 of file Model1Feature.h.
Moses::Model1Vocabulary::Model1Vocabulary | ( | ) |
Definition at line 15 of file Model1Feature.cpp.
References Moses::FactorCollection::AddFactor(), GIZANULL, Moses::FactorCollection::Instance(), m_NULL, and Store().
const Factor * Moses::Model1Vocabulary::GetWord | ( | unsigned | id | ) | const |
Definition at line 59 of file Model1Feature.cpp.
Referenced by Moses::Model1LexicalTable::Load().
unsigned Moses::Model1Vocabulary::GetWordID | ( | const Factor * | word | ) | const |
void Moses::Model1Vocabulary::Load | ( | const std::string & | fileName | ) |
Definition at line 67 of file Model1Feature.cpp.
References Moses::FactorCollection::AddFactor(), Moses::InputFileStream::Close(), Moses::FactorCollection::Instance(), Store(), Moses::Tokenize(), and UTIL_THROW_IF2.
bool Moses::Model1Vocabulary::Store | ( | const Factor * | word, | |
const unsigned | id | |||
) |
Definition at line 22 of file Model1Feature.cpp.
References m_lookup, and m_vocab.
Referenced by Load(), and Model1Vocabulary().
unsigned Moses::Model1Vocabulary::StoreIfNew | ( | const Factor * | word | ) |
const std::string Moses::Model1Vocabulary::GIZANULL = "GIZANULL" [static] |
boost::unordered_map<const Factor*, unsigned> Moses::Model1Vocabulary::m_lookup [protected] |
Definition at line 32 of file Model1Feature.h.
Referenced by GetWordID(), Store(), and StoreIfNew().
const Factor* Moses::Model1Vocabulary::m_NULL [protected] |
std::vector< const Factor* > Moses::Model1Vocabulary::m_vocab [protected] |