SphinxBase  5prealpha
ngram_funcs_s Struct Reference

Implementation-specific functions for operating on ngram_model_t objects. More...

#include <ngram_model_internal.h>

Data Fields

void(* free )(ngram_model_t *model)
 Implementation-specific function for freeing an ngram_model_t.
 
int(* apply_weights )(ngram_model_t *model, float32 lw, float32 wip)
 Implementation-specific function for applying language model weights.
 
int32(* score )(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)
 Implementation-specific function for querying language model score.
 
int32(* raw_score )(ngram_model_t *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)
 Implementation-specific function for querying raw language model probability.
 
int32(* add_ug )(ngram_model_t *model, int32 wid, int32 lweight)
 Implementation-specific function for adding unigrams. More...
 
void(* flush )(ngram_model_t *model)
 Implementation-specific function for purging N-Gram cache.
 

Detailed Description

Implementation-specific functions for operating on ngram_model_t objects.

Definition at line 110 of file ngram_model_internal.h.

Field Documentation

int32(* ngram_funcs_s::add_ug)(ngram_model_t *model, int32 wid, int32 lweight)

Implementation-specific function for adding unigrams.

This function updates the internal structures of a language model to add the given unigram with the given weight (defined as a log-factor applied to the uniform distribution). This includes reallocating or otherwise resizing the set of unigrams.

Returns
The language model score (not raw log-probability) of the new word, or 0 for failure.

Definition at line 143 of file ngram_model_internal.h.

Referenced by ngram_model_add_word().


The documentation for this struct was generated from the following file: