Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
lm::ngram::detail::GenericModel< Search, VocabularyT > Class Template Reference

#include <model.hh>

Inheritance diagram for lm::ngram::detail::GenericModel< Search, VocabularyT >:
[legend]
Collaboration diagram for lm::ngram::detail::GenericModel< Search, VocabularyT >:
[legend]

List of all members.

Public Member Functions

 GenericModel (const char *file, const Config &config=Config())
FullScoreReturn FullScore (const State &in_state, const WordIndex new_word, State &out_state) const
FullScoreReturn FullScoreForgotState (const WordIndex *context_rbegin, const WordIndex *context_rend, const WordIndex new_word, State &out_state) const
void GetState (const WordIndex *context_rbegin, const WordIndex *context_rend, State &out_state) const

Static Public Member Functions

static size_t Size (const std::vector< uint64_t > &counts, const Config &config=Config())

Static Public Attributes

static const ModelType kModelType = Search::kModelType

Private Types

typedef base::ModelFacade
< GenericModel< Search,
VocabularyT >, State,
VocabularyT > 
P
typedef Search::Middle Middle

Private Member Functions

float SlowBackoffLookup (const WordIndex *const context_rbegin, const WordIndex *const context_rend, unsigned char start) const
FullScoreReturn ScoreExceptBackoff (const WordIndex *context_rbegin, const WordIndex *context_rend, const WordIndex new_word, State &out_state) const
void SetupMemory (void *start, const std::vector< uint64_t > &counts, const Config &config)
void InitializeFromBinary (void *start, const Parameters &params, const Config &config, int fd)
void InitializeFromARPA (const char *file, const Config &config)
BackingMutableBacking ()

Static Private Member Functions

static void UpdateConfigFromBinary (int fd, const std::vector< uint64_t > &counts, Config &config)

Private Attributes

Backing backing_
VocabularyT vocab_
Search search_

Friends

void LoadLM (const char *file, const Config &config, GenericModel< Search, VocabularyT > &to)

template<class Search, class VocabularyT>
class lm::ngram::detail::GenericModel< Search, VocabularyT >


Member Typedef Documentation

template<class Search , class VocabularyT >
typedef Search::Middle lm::ngram::detail::GenericModel< Search, VocabularyT >::Middle [private]
template<class Search , class VocabularyT >
typedef base::ModelFacade<GenericModel<Search, VocabularyT>, State, VocabularyT> lm::ngram::detail::GenericModel< Search, VocabularyT >::P [private]

Constructor & Destructor Documentation

template<class Search , class VocabularyT >
lm::ngram::detail::GenericModel< Search, VocabularyT >::GenericModel ( const char *  file,
const Config config = Config() 
)

Here is the call graph for this function:


Member Function Documentation

template<class Search , class VocabularyT >
FullScoreReturn lm::ngram::detail::GenericModel< Search, VocabularyT >::FullScore ( const State in_state,
const WordIndex  new_word,
State out_state 
) const
template<class Search , class VocabularyT >
FullScoreReturn lm::ngram::detail::GenericModel< Search, VocabularyT >::FullScoreForgotState ( const WordIndex context_rbegin,
const WordIndex context_rend,
const WordIndex  new_word,
State out_state 
) const
template<class Search , class VocabularyT >
void lm::ngram::detail::GenericModel< Search, VocabularyT >::GetState ( const WordIndex context_rbegin,
const WordIndex context_rend,
State out_state 
) const

Here is the call graph for this function:

template<class Search , class VocabularyT >
void lm::ngram::detail::GenericModel< Search, VocabularyT >::InitializeFromARPA ( const char *  file,
const Config config 
) [private]

Here is the call graph for this function:

template<class Search , class VocabularyT >
void lm::ngram::detail::GenericModel< Search, VocabularyT >::InitializeFromBinary ( void *  start,
const Parameters params,
const Config config,
int  fd 
) [private]
template<class Search , class VocabularyT >
Backing& lm::ngram::detail::GenericModel< Search, VocabularyT >::MutableBacking ( ) [private]
template<class Search , class VocabularyT >
FullScoreReturn lm::ngram::detail::GenericModel< Search, VocabularyT >::ScoreExceptBackoff ( const WordIndex context_rbegin,
const WordIndex context_rend,
const WordIndex  new_word,
State out_state 
) const [private]

Here is the call graph for this function:

template<class Search , class VocabularyT >
void lm::ngram::detail::GenericModel< Search, VocabularyT >::SetupMemory ( void *  start,
const std::vector< uint64_t > &  counts,
const Config config 
) [private]
template<class Search , class VocabularyT >
size_t lm::ngram::detail::GenericModel< Search, VocabularyT >::Size ( const std::vector< uint64_t > &  counts,
const Config config = Config() 
) [static]

Here is the caller graph for this function:

template<class Search , class VocabularyT >
float lm::ngram::detail::GenericModel< Search, VocabularyT >::SlowBackoffLookup ( const WordIndex *const  context_rbegin,
const WordIndex *const  context_rend,
unsigned char  start 
) const [private]
template<class Search , class VocabularyT >
static void lm::ngram::detail::GenericModel< Search, VocabularyT >::UpdateConfigFromBinary ( int  fd,
const std::vector< uint64_t > &  counts,
Config config 
) [static, private]

Here is the call graph for this function:


Friends And Related Function Documentation

template<class Search , class VocabularyT >
void LoadLM ( const char *  file,
const Config config,
GenericModel< Search, VocabularyT > &  to 
) [friend]

Member Data Documentation

template<class Search , class VocabularyT >
Backing lm::ngram::detail::GenericModel< Search, VocabularyT >::backing_ [private]
template<class Search , class VocabularyT >
const ModelType lm::ngram::detail::GenericModel< Search, VocabularyT >::kModelType = Search::kModelType [static]
template<class Search , class VocabularyT >
Search lm::ngram::detail::GenericModel< Search, VocabularyT >::search_ [private]
template<class Search , class VocabularyT >
VocabularyT lm::ngram::detail::GenericModel< Search, VocabularyT >::vocab_ [private]