Edinburgh Speech Tools  2.1-release
EST_Ngrammar Class Reference

#include <include/EST_Ngrammar.h>

Collaboration diagram for EST_Ngrammar:

Public Types

enum  representation_t { sparse, dense, backoff }
 
enum  entry_t { frequencies, log_frequencies }
 

Public Member Functions

 EST_Ngrammar ()
 
 EST_Ngrammar (int o, representation_t r, const EST_StrList &wordlist)
 
 EST_Ngrammar (int o, representation_t r, const EST_StrList &wordlist, const EST_StrList &predlist)
 
 EST_Ngrammar (int o, representation_t r, EST_Discrete &v)
 
 ~EST_Ngrammar ()
 
void default_values ()
 
void clear ()
 
bool init (int o, representation_t r, const EST_StrList &wordlist)
 
bool init (int o, representation_t r, const EST_StrList &wordlist, const EST_StrList &predlist)
 
bool init (int o, representation_t r, EST_Discrete &v)
 
bool init (int o, representation_t r, EST_Discrete &v, EST_Discrete &pv)
 
int num_states (void) const
 
double samples (void) const
 
int order () const
 
int get_vocab_length () const
 
EST_String get_vocab_word (int i) const
 
int get_vocab_word (const EST_String &s) const
 
int get_pred_vocab_length () const
 
EST_String get_pred_vocab_word (int i) const
 
int get_pred_vocab_word (const EST_String &s) const
 
int closed_vocab () const
 
entry_t entry_type () const
 
representation_t representation () const
 
bool build (const EST_StrList &filenames, const EST_String &prev=SENTENCE_START_MARKER, const EST_String &prev_prev=SENTENCE_END_MARKER, const EST_String &last=SENTENCE_END_MARKER, const EST_String &input_format="", const EST_String &oov_mode="", const int mincount=1, const int maxcount=10)
 
void accumulate (const EST_StrVector &words, const double count=1)
 
void accumulate (const EST_IVector &words, const double count=1)
 
void make_htk_compatible ()
 
EST_read_status load (const EST_String &filename)
 
EST_read_status load (const EST_String &filename, const EST_StrList &wordlist)
 
EST_write_status save (const EST_String &filename, const EST_String type="cstr_ascii", const bool trace=false, double floor=0.0)
 
int wordlist_index (const EST_String &word, const bool report=true) const
 
const EST_Stringwordlist_index (int i) const
 
int predlist_index (const EST_String &word) const
 
const EST_Stringpredlist_index (int i) const
 
bool set_entry_type (entry_t new_type)
 
bool set_representation (representation_t new_representation)
 
double probability (const EST_StrVector &words, bool force=false, const bool trace=false) const
 
double frequency (const EST_StrVector &words, bool force=false, const bool trace=false) const
 
const EST_Stringpredict (const EST_StrVector &words, double *prob, int *state) const
 
const EST_Stringpredict (const EST_StrVector &words) const
 
const EST_Stringpredict (const EST_StrVector &words, double *prob) const
 
const EST_Stringpredict (const EST_IVector &words, double *prob, int *state) const
 
const EST_Stringpredict (const EST_IVector &words) const
 
const EST_Stringpredict (const EST_IVector &words, double *prob) const
 
int find_state_id (const EST_StrVector &words) const
 
int find_state_id (const EST_IVector &words) const
 
int find_next_state_id (int state, int word) const
 
double reverse_probability (const EST_StrVector &words, bool force=false) const
 
double reverse_probability (const EST_IVector &words, bool force=false) const
 
const EST_DiscreteProbDistributionprob_dist (const EST_StrVector &words) const
 
const EST_DiscreteProbDistributionprob_dist (const EST_IVector &words) const
 
const EST_DiscreteProbDistributionprob_dist (int state) const
 
void fill_window_start (EST_IVector &window, const EST_String &prev, const EST_String &prev_prev) const
 
void fill_window_start (EST_StrVector &window, const EST_String &prev, const EST_String &prev_prev) const
 
bool ngram_exists (const EST_StrVector &words) const
 
bool ngram_exists (const EST_StrVector &words, const double threshold) const
 
double get_backoff_weight (const EST_StrVector &words) const
 
bool set_backoff_weight (const EST_StrVector &words, const double w)
 
void print_freqs (ostream &os, double floor=0.0)
 
bool compute_backoff_weights (const int mincount=1, const int maxcount=10)
 
bool merge (EST_Ngrammar &n, float weight)
 

Protected Member Functions

bool init_sparse_representation ()
 
bool init_dense_representation ()
 
double get_backoff_discount (const int order, const double freq) const
 
bool init_backoff_representation ()
 
void prune_backoff_representation (EST_BackoffNgrammarState *start_state=NULL)
 
void backoff_restore_unigram_states ()
 
int find_dense_state_index (const EST_IVector &words, int index=0) const
 
const EST_StrVectormake_ngram_from_index (const int i) const
 
bool init_vocab (const EST_StrList &wordlist)
 
bool init_vocab (const EST_StrList &word_list, const EST_StrList &pred_list)
 
bool check_vocab (const EST_StrList &wordlist)
 
const EST_Stringlastword (const EST_StrVector &words) const
 
int lastword (const EST_IVector &words) const
 
bool sparse_to_dense ()
 
bool dense_to_sparse ()
 
void take_logs ()
 
void take_exps ()
 
void freqs_to_probs ()
 
bool build_sparse (const EST_String &filename, const EST_String &prev, const EST_String &prev_prev, const EST_String &last)
 
bool build_ngram (const EST_String &filename, const EST_String &prev, const EST_String &prev_prev, const EST_String &last, const EST_String &input_format)
 
void iterate (EST_StrVector &words, void(*function)(EST_Ngrammar *n, EST_StrVector &words, void *params), void *params)
 
void const_iterate (EST_StrVector &words, void(*function)(const EST_Ngrammar *const n, EST_StrVector &words, void *params), void *params) const
 
bool p_init (int o, representation_t r)
 
bool oov_preprocess (const EST_String &filename, EST_String &new_filename, const EST_String &what)
 
const EST_NgrammarStatefind_state_const (const EST_StrVector &words) const
 
EST_NgrammarStatefind_state (const EST_StrVector &words)
 
const EST_NgrammarStatefind_state_const (const EST_IVector &words) const
 
EST_NgrammarStatefind_state (const EST_IVector &words)
 
const EST_DiscreteProbDistributionbackoff_prob_dist (const EST_StrVector &words) const
 
double backoff_reverse_probability_sub (const EST_StrVector &words, const EST_BackoffNgrammarState *root) const
 
double backoff_probability (const EST_StrVector &words, const bool trace=false) const
 
double backoff_reverse_probability (const EST_StrVector &words) const
 
const EST_Stringbackoff_most_probable (const EST_StrVector &words, double *prob=NULL) const
 
void backoff_traverse (EST_BackoffNgrammarState *start_state, void(*function)(EST_BackoffNgrammarState *s, void *params), void *params)
 
void backoff_traverse (EST_BackoffNgrammarState *start_state, void(*function)(EST_BackoffNgrammarState *s, void *params), void *params, const int level)
 

Protected Attributes

int p_order
 
int p_num_samples
 
double p_number_of_sentences
 
EST_String p_sentence_start_marker
 
EST_String p_sentence_end_marker
 
representation_t p_representation
 
entry_t p_entry_type
 
EST_PredictionSuffixTree sparse_representation
 
EST_BackoffNgrammarStatebackoff_representation
 
double backoff_threshold
 
double backoff_unigram_floor_freq
 
EST_DVectorbackoff_discount
 
int p_num_states
 
EST_NgrammarStatep_states
 
EST_Discretevocab
 
EST_Discretepred_vocab
 
EST_DiscreteProbDistribution vocab_pdf
 
bool allow_oov
 

Friends

class EST_BackoffNgrammar
 
ostream & operator<< (ostream &s, EST_Ngrammar &n)
 
EST_read_status load_ngram_htk_ascii (const EST_String filename, EST_Ngrammar &n)
 
EST_read_status load_ngram_htk_binary (const EST_String filename, EST_Ngrammar &n)
 
EST_read_status load_ngram_arpa (const EST_String filename, EST_Ngrammar &n, const EST_StrList &vocab)
 
EST_read_status load_ngram_cstr_ascii (const EST_String filename, EST_Ngrammar &n)
 
EST_read_status load_ngram_cstr_bin (const EST_String filename, EST_Ngrammar &n)
 
EST_write_status save_ngram_htk_ascii_sub (const EST_String &word, ostream *ost, EST_Ngrammar &n, double floor)
 
EST_write_status save_ngram_htk_ascii (const EST_String filename, EST_Ngrammar &n, double floor)
 
EST_write_status save_ngram_cstr_ascii (const EST_String filename, EST_Ngrammar &n, const bool trace, double floor)
 
EST_write_status save_ngram_cstr_bin (const EST_String filename, EST_Ngrammar &n, const bool trace, double floor)
 
EST_write_status save_ngram_arpa (const EST_String filename, EST_Ngrammar &n)
 
EST_write_status save_ngram_arpa_sub (ostream *ost, EST_Ngrammar &n, const EST_StrVector &words)
 
EST_write_status save_ngram_wfst (const EST_String filename, EST_Ngrammar &n)
 
void frequency_of_frequencies (EST_DVector &ff, EST_Ngrammar &n, int this_order)
 
void map_frequencies (EST_Ngrammar &n, const EST_DVector &map, const int this_order)
 
bool Good_Turing_smooth (EST_Ngrammar &n, int maxcount, int mincount)
 
void Good_Turing_discount (EST_Ngrammar &ngrammar, const int maxcount, const double default_discount)
 
void fs_build_backoff_ngrams (EST_Ngrammar *backoff_ngrams, EST_Ngrammar &ngram)
 
int fs_backoff_smooth (EST_Ngrammar *backoff_ngrams, EST_Ngrammar &ngram, int smooth_thresh)
 

Detailed Description

Definition at line 216 of file EST_Ngrammar.h.

Member Enumeration Documentation

Enumerator
sparse 
dense 
backoff 

Definition at line 221 of file EST_Ngrammar.h.

Enumerator
frequencies 
log_frequencies 

Definition at line 226 of file EST_Ngrammar.h.

Constructor & Destructor Documentation

EST_Ngrammar::EST_Ngrammar ( )
inline

Definition at line 373 of file EST_Ngrammar.h.

EST_Ngrammar::EST_Ngrammar ( int  o,
representation_t  r,
const EST_StrList wordlist 
)
inline

Definition at line 381 of file EST_Ngrammar.h.

EST_Ngrammar::EST_Ngrammar ( int  o,
representation_t  r,
const EST_StrList wordlist,
const EST_StrList predlist 
)
inline

Definition at line 388 of file EST_Ngrammar.h.

EST_Ngrammar::EST_Ngrammar ( int  o,
representation_t  r,
EST_Discrete v 
)
inline

Definition at line 395 of file EST_Ngrammar.h.

EST_Ngrammar::~EST_Ngrammar ( )

Definition at line 499 of file EST_Ngrammar.cc.

Member Function Documentation

bool EST_Ngrammar::init_sparse_representation ( )
protected

Definition at line 596 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init_dense_representation ( )
protected

Definition at line 576 of file EST_Ngrammar.cc.

double EST_Ngrammar::get_backoff_discount ( const int  order,
const double  freq 
) const
protected

Definition at line 2385 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init_backoff_representation ( )
protected

Definition at line 612 of file EST_Ngrammar.cc.

void EST_Ngrammar::prune_backoff_representation ( EST_BackoffNgrammarState start_state = NULL)
protected

Definition at line 1579 of file EST_Ngrammar.cc.

void EST_Ngrammar::backoff_restore_unigram_states ( )
protected

Definition at line 1559 of file EST_Ngrammar.cc.

int EST_Ngrammar::find_dense_state_index ( const EST_IVector words,
int  index = 0 
) const
protected

Definition at line 1683 of file EST_Ngrammar.cc.

const EST_StrVector & EST_Ngrammar::make_ngram_from_index ( const int  i) const
protected

Definition at line 622 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init_vocab ( const EST_StrList wordlist)
protected

Definition at line 652 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init_vocab ( const EST_StrList word_list,
const EST_StrList pred_list 
)
protected

Definition at line 664 of file EST_Ngrammar.cc.

bool EST_Ngrammar::check_vocab ( const EST_StrList wordlist)
protected

Definition at line 678 of file EST_Ngrammar.cc.

const EST_String& EST_Ngrammar::lastword ( const EST_StrVector words) const
inlineprotected

Definition at line 294 of file EST_Ngrammar.h.

int EST_Ngrammar::lastword ( const EST_IVector words) const
inlineprotected

Definition at line 296 of file EST_Ngrammar.h.

bool EST_Ngrammar::sparse_to_dense ( )
protected

Definition at line 1669 of file EST_Ngrammar.cc.

bool EST_Ngrammar::dense_to_sparse ( )
protected

Definition at line 1676 of file EST_Ngrammar.cc.

void EST_Ngrammar::take_logs ( )
protected
void EST_Ngrammar::take_exps ( )
protected
void EST_Ngrammar::freqs_to_probs ( )
protected
bool EST_Ngrammar::build_sparse ( const EST_String filename,
const EST_String prev,
const EST_String prev_prev,
const EST_String last 
)
protected

Definition at line 1021 of file EST_Ngrammar.cc.

bool EST_Ngrammar::build_ngram ( const EST_String filename,
const EST_String prev,
const EST_String prev_prev,
const EST_String last,
const EST_String input_format 
)
protected

Definition at line 1165 of file EST_Ngrammar.cc.

void EST_Ngrammar::iterate ( EST_StrVector words,
void(*)(EST_Ngrammar *n, EST_StrVector &words, void *params)  function,
void *  params 
)
protected

Definition at line 2227 of file EST_Ngrammar.cc.

void EST_Ngrammar::const_iterate ( EST_StrVector words,
void(*)(const EST_Ngrammar *const n, EST_StrVector &words, void *params)  function,
void *  params 
) const
protected

Definition at line 2273 of file EST_Ngrammar.cc.

bool EST_Ngrammar::p_init ( int  o,
EST_Ngrammar::representation_t  r 
)
protected

Definition at line 540 of file EST_Ngrammar.cc.

bool EST_Ngrammar::oov_preprocess ( const EST_String filename,
EST_String new_filename,
const EST_String what 
)
protected

Definition at line 1053 of file EST_Ngrammar.cc.

const EST_NgrammarState & EST_Ngrammar::find_state_const ( const EST_StrVector words) const
protected

Definition at line 1743 of file EST_Ngrammar.cc.

EST_NgrammarState & EST_Ngrammar::find_state ( const EST_StrVector words)
protected

Definition at line 1705 of file EST_Ngrammar.cc.

const EST_NgrammarState & EST_Ngrammar::find_state_const ( const EST_IVector words) const
protected

Definition at line 1805 of file EST_Ngrammar.cc.

EST_NgrammarState & EST_Ngrammar::find_state ( const EST_IVector words)
protected

Definition at line 1779 of file EST_Ngrammar.cc.

const EST_DiscreteProbDistribution & EST_Ngrammar::backoff_prob_dist ( const EST_StrVector words) const
protected

Definition at line 2360 of file EST_Ngrammar.cc.

double EST_Ngrammar::backoff_reverse_probability_sub ( const EST_StrVector words,
const EST_BackoffNgrammarState root 
) const
protected

Definition at line 2517 of file EST_Ngrammar.cc.

double EST_Ngrammar::backoff_probability ( const EST_StrVector words,
const bool  trace = false 
) const
protected

Definition at line 2400 of file EST_Ngrammar.cc.

double EST_Ngrammar::backoff_reverse_probability ( const EST_StrVector words) const
protected

Definition at line 2584 of file EST_Ngrammar.cc.

const EST_String & EST_Ngrammar::backoff_most_probable ( const EST_StrVector words,
double *  prob = NULL 
) const
protected

Definition at line 2608 of file EST_Ngrammar.cc.

void EST_Ngrammar::backoff_traverse ( EST_BackoffNgrammarState start_state,
void(*)(EST_BackoffNgrammarState *s, void *params)  function,
void *  params 
)
protected

Definition at line 2647 of file EST_Ngrammar.cc.

void EST_Ngrammar::backoff_traverse ( EST_BackoffNgrammarState start_state,
void(*)(EST_BackoffNgrammarState *s, void *params)  function,
void *  params,
const int  level 
)
protected

Definition at line 2673 of file EST_Ngrammar.cc.

void EST_Ngrammar::default_values ( )

Definition at line 484 of file EST_Ngrammar.cc.

void EST_Ngrammar::clear ( )

Definition at line 504 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init ( int  o,
EST_Ngrammar::representation_t  r,
const EST_StrList wordlist 
)

Definition at line 509 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init ( int  o,
EST_Ngrammar::representation_t  r,
const EST_StrList wordlist,
const EST_StrList predlist 
)

Definition at line 515 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init ( int  o,
EST_Ngrammar::representation_t  r,
EST_Discrete v 
)

Definition at line 522 of file EST_Ngrammar.cc.

bool EST_Ngrammar::init ( int  o,
EST_Ngrammar::representation_t  r,
EST_Discrete v,
EST_Discrete pv 
)

Definition at line 531 of file EST_Ngrammar.cc.

int EST_Ngrammar::num_states ( void  ) const
inline

Definition at line 413 of file EST_Ngrammar.h.

double EST_Ngrammar::samples ( void  ) const
inline

Definition at line 414 of file EST_Ngrammar.h.

int EST_Ngrammar::order ( ) const
inline

Definition at line 415 of file EST_Ngrammar.h.

int EST_Ngrammar::get_vocab_length ( ) const
inline

Definition at line 416 of file EST_Ngrammar.h.

EST_String EST_Ngrammar::get_vocab_word ( int  i) const

Definition at line 1983 of file EST_Ngrammar.cc.

int EST_Ngrammar::get_vocab_word ( const EST_String s) const

Definition at line 1991 of file EST_Ngrammar.cc.

int EST_Ngrammar::get_pred_vocab_length ( ) const
inline

Definition at line 419 of file EST_Ngrammar.h.

EST_String EST_Ngrammar::get_pred_vocab_word ( int  i) const
inline

Definition at line 420 of file EST_Ngrammar.h.

int EST_Ngrammar::get_pred_vocab_word ( const EST_String s) const
inline

Definition at line 421 of file EST_Ngrammar.h.

int EST_Ngrammar::closed_vocab ( ) const
inline

Definition at line 423 of file EST_Ngrammar.h.

entry_t EST_Ngrammar::entry_type ( ) const
inline

Definition at line 424 of file EST_Ngrammar.h.

representation_t EST_Ngrammar::representation ( ) const
inline

Definition at line 425 of file EST_Ngrammar.h.

bool EST_Ngrammar::build ( const EST_StrList filenames,
const EST_String prev = SENTENCE_START_MARKER,
const EST_String prev_prev = SENTENCE_END_MARKER,
const EST_String last = SENTENCE_END_MARKER,
const EST_String input_format = "",
const EST_String oov_mode = "",
const int  mincount = 1,
const int  maxcount = 10 
)

Definition at line 760 of file EST_Ngrammar.cc.

void EST_Ngrammar::accumulate ( const EST_StrVector words,
const double  count = 1 
)

Definition at line 885 of file EST_Ngrammar.cc.

void EST_Ngrammar::accumulate ( const EST_IVector words,
const double  count = 1 
)

Definition at line 915 of file EST_Ngrammar.cc.

void EST_Ngrammar::make_htk_compatible ( )

Definition at line 2196 of file EST_Ngrammar.cc.

EST_read_status EST_Ngrammar::load ( const EST_String filename)

Definition at line 2115 of file EST_Ngrammar.cc.

EST_read_status EST_Ngrammar::load ( const EST_String filename,
const EST_StrList wordlist 
)

Definition at line 2151 of file EST_Ngrammar.cc.

EST_write_status EST_Ngrammar::save ( const EST_String filename,
const EST_String  type = "cstr_ascii",
const bool  trace = false,
double  floor = 0.0 
)

Definition at line 2204 of file EST_Ngrammar.cc.

int EST_Ngrammar::wordlist_index ( const EST_String word,
const bool  report = true 
) const

Definition at line 734 of file EST_Ngrammar.cc.

const EST_String & EST_Ngrammar::wordlist_index ( int  i) const

Definition at line 698 of file EST_Ngrammar.cc.

int EST_Ngrammar::predlist_index ( const EST_String word) const

Definition at line 703 of file EST_Ngrammar.cc.

const EST_String & EST_Ngrammar::predlist_index ( int  i) const

Definition at line 729 of file EST_Ngrammar.cc.

bool EST_Ngrammar::set_entry_type ( EST_Ngrammar::entry_t  new_type)

Definition at line 1658 of file EST_Ngrammar.cc.

bool EST_Ngrammar::set_representation ( EST_Ngrammar::representation_t  new_representation)

Definition at line 1830 of file EST_Ngrammar.cc.

double EST_Ngrammar::probability ( const EST_StrVector words,
bool  force = false,
const bool  trace = false 
) const

Definition at line 1847 of file EST_Ngrammar.cc.

double EST_Ngrammar::frequency ( const EST_StrVector words,
bool  force = false,
const bool  trace = false 
) const

Definition at line 1870 of file EST_Ngrammar.cc.

const EST_String & EST_Ngrammar::predict ( const EST_StrVector words,
double *  prob,
int state 
) const

Definition at line 1893 of file EST_Ngrammar.cc.

const EST_String& EST_Ngrammar::predict ( const EST_StrVector words) const
inline

Definition at line 476 of file EST_Ngrammar.h.

const EST_String& EST_Ngrammar::predict ( const EST_StrVector words,
double *  prob 
) const
inline

Definition at line 478 of file EST_Ngrammar.h.

const EST_String & EST_Ngrammar::predict ( const EST_IVector words,
double *  prob,
int state 
) const

Definition at line 1921 of file EST_Ngrammar.cc.

const EST_String& EST_Ngrammar::predict ( const EST_IVector words) const
inline

Definition at line 482 of file EST_Ngrammar.h.

const EST_String& EST_Ngrammar::predict ( const EST_IVector words,
double *  prob 
) const
inline

Definition at line 484 of file EST_Ngrammar.h.

int EST_Ngrammar::find_state_id ( const EST_StrVector words) const

Definition at line 1949 of file EST_Ngrammar.cc.

int EST_Ngrammar::find_state_id ( const EST_IVector words) const

Definition at line 1966 of file EST_Ngrammar.cc.

int EST_Ngrammar::find_next_state_id ( int  state,
int  word 
) const

Definition at line 1693 of file EST_Ngrammar.cc.

double EST_Ngrammar::reverse_probability ( const EST_StrVector words,
bool  force = false 
) const

Definition at line 1997 of file EST_Ngrammar.cc.

double EST_Ngrammar::reverse_probability ( const EST_IVector words,
bool  force = false 
) const

Definition at line 2026 of file EST_Ngrammar.cc.

const EST_DiscreteProbDistribution & EST_Ngrammar::prob_dist ( const EST_StrVector words) const

Definition at line 2064 of file EST_Ngrammar.cc.

const EST_DiscreteProbDistribution & EST_Ngrammar::prob_dist ( const EST_IVector words) const

Definition at line 2089 of file EST_Ngrammar.cc.

const EST_DiscreteProbDistribution & EST_Ngrammar::prob_dist ( int  state) const

Definition at line 2058 of file EST_Ngrammar.cc.

void EST_Ngrammar::fill_window_start ( EST_IVector window,
const EST_String prev,
const EST_String prev_prev 
) const

Definition at line 1031 of file EST_Ngrammar.cc.

void EST_Ngrammar::fill_window_start ( EST_StrVector window,
const EST_String prev,
const EST_String prev_prev 
) const

Definition at line 1042 of file EST_Ngrammar.cc.

bool EST_Ngrammar::ngram_exists ( const EST_StrVector words) const

Definition at line 957 of file EST_Ngrammar.cc.

bool EST_Ngrammar::ngram_exists ( const EST_StrVector words,
const double  threshold 
) const

Definition at line 985 of file EST_Ngrammar.cc.

double EST_Ngrammar::get_backoff_weight ( const EST_StrVector words) const

Definition at line 998 of file EST_Ngrammar.cc.

bool EST_Ngrammar::set_backoff_weight ( const EST_StrVector words,
const double  w 
)

Definition at line 1009 of file EST_Ngrammar.cc.

void EST_Ngrammar::print_freqs ( ostream &  os,
double  floor = 0.0 
)

Definition at line 2319 of file EST_Ngrammar.cc.

bool EST_Ngrammar::compute_backoff_weights ( const int  mincount = 1,
const int  maxcount = 10 
)

Definition at line 1490 of file EST_Ngrammar.cc.

bool EST_Ngrammar::merge ( EST_Ngrammar n,
float  weight 
)

Definition at line 2719 of file EST_Ngrammar.cc.

Friends And Related Function Documentation

friend class EST_BackoffNgrammar
friend

Definition at line 596 of file EST_Ngrammar.h.

ostream& operator<< ( ostream &  s,
EST_Ngrammar n 
)
friend

Definition at line 1630 of file EST_Ngrammar.cc.

EST_read_status load_ngram_htk_ascii ( const EST_String  filename,
EST_Ngrammar n 
)
friend

Definition at line 58 of file ngrammar_io.cc.

EST_read_status load_ngram_htk_binary ( const EST_String  filename,
EST_Ngrammar n 
)
friend

Definition at line 66 of file ngrammar_io.cc.

EST_read_status load_ngram_arpa ( const EST_String  filename,
EST_Ngrammar n,
const EST_StrList vocab 
)
friend

Definition at line 74 of file ngrammar_io.cc.

EST_read_status load_ngram_cstr_ascii ( const EST_String  filename,
EST_Ngrammar n 
)
friend

Definition at line 227 of file ngrammar_io.cc.

EST_read_status load_ngram_cstr_bin ( const EST_String  filename,
EST_Ngrammar n 
)
friend

Definition at line 289 of file ngrammar_io.cc.

EST_write_status save_ngram_htk_ascii_sub ( const EST_String word,
ostream *  ost,
EST_Ngrammar n,
double  floor 
)
friend

Definition at line 424 of file ngrammar_io.cc.

EST_write_status save_ngram_htk_ascii ( const EST_String  filename,
EST_Ngrammar n,
double  floor 
)
friend

Definition at line 565 of file ngrammar_io.cc.

EST_write_status save_ngram_cstr_ascii ( const EST_String  filename,
EST_Ngrammar n,
const bool  trace,
double  floor 
)
friend

Definition at line 747 of file ngrammar_io.cc.

EST_write_status save_ngram_cstr_bin ( const EST_String  filename,
EST_Ngrammar n,
const bool  trace,
double  floor 
)
friend

Definition at line 844 of file ngrammar_io.cc.

EST_write_status save_ngram_arpa ( const EST_String  filename,
EST_Ngrammar n 
)
friend

Definition at line 670 of file ngrammar_io.cc.

EST_write_status save_ngram_arpa_sub ( ostream *  ost,
EST_Ngrammar n,
const EST_StrVector words 
)
friend
EST_write_status save_ngram_wfst ( const EST_String  filename,
EST_Ngrammar n 
)
friend

Definition at line 806 of file ngrammar_io.cc.

void frequency_of_frequencies ( EST_DVector ff,
EST_Ngrammar n,
int  this_order 
)
friend

Definition at line 207 of file ngrammar_aux.cc.

void map_frequencies ( EST_Ngrammar n,
const EST_DVector map,
const int  this_order 
)
friend

Definition at line 306 of file ngrammar_aux.cc.

bool Good_Turing_smooth ( EST_Ngrammar n,
int  maxcount,
int  mincount 
)
friend

Definition at line 410 of file ngrammar_aux.cc.

void Good_Turing_discount ( EST_Ngrammar ngrammar,
const int  maxcount,
const double  default_discount 
)
friend

Definition at line 540 of file ngrammar_aux.cc.

void fs_build_backoff_ngrams ( EST_Ngrammar backoff_ngrams,
EST_Ngrammar ngram 
)
friend

Definition at line 75 of file freqsmooth.cc.

int fs_backoff_smooth ( EST_Ngrammar backoff_ngrams,
EST_Ngrammar ngram,
int  smooth_thresh 
)
friend

Definition at line 111 of file freqsmooth.cc.

Member Data Documentation

int EST_Ngrammar::p_order
protected

Definition at line 232 of file EST_Ngrammar.h.

int EST_Ngrammar::p_num_samples
protected

Definition at line 233 of file EST_Ngrammar.h.

double EST_Ngrammar::p_number_of_sentences
protected

Definition at line 235 of file EST_Ngrammar.h.

EST_String EST_Ngrammar::p_sentence_start_marker
protected

Definition at line 238 of file EST_Ngrammar.h.

EST_String EST_Ngrammar::p_sentence_end_marker
protected

Definition at line 239 of file EST_Ngrammar.h.

representation_t EST_Ngrammar::p_representation
protected

Definition at line 242 of file EST_Ngrammar.h.

entry_t EST_Ngrammar::p_entry_type
protected

Definition at line 243 of file EST_Ngrammar.h.

EST_PredictionSuffixTree EST_Ngrammar::sparse_representation
protected

Definition at line 247 of file EST_Ngrammar.h.

EST_BackoffNgrammarState* EST_Ngrammar::backoff_representation
protected

Definition at line 257 of file EST_Ngrammar.h.

double EST_Ngrammar::backoff_threshold
protected

Definition at line 259 of file EST_Ngrammar.h.

double EST_Ngrammar::backoff_unigram_floor_freq
protected

Definition at line 262 of file EST_Ngrammar.h.

EST_DVector* EST_Ngrammar::backoff_discount
protected

Definition at line 269 of file EST_Ngrammar.h.

int EST_Ngrammar::p_num_states
protected

Definition at line 275 of file EST_Ngrammar.h.

EST_NgrammarState* EST_Ngrammar::p_states
protected

Definition at line 276 of file EST_Ngrammar.h.

EST_Discrete* EST_Ngrammar::vocab
protected

Definition at line 283 of file EST_Ngrammar.h.

EST_Discrete* EST_Ngrammar::pred_vocab
protected

Definition at line 284 of file EST_Ngrammar.h.

EST_DiscreteProbDistribution EST_Ngrammar::vocab_pdf
protected

Definition at line 292 of file EST_Ngrammar.h.

bool EST_Ngrammar::allow_oov
protected

Definition at line 299 of file EST_Ngrammar.h.


The documentation for this class was generated from the following files: