Edinburgh Speech Tools  2.1-release
EST_Ngrammar.h File Reference
#include <cstdarg>
#include <cstdlib>
#include "EST_String.h"
#include "EST_Val.h"
#include "EST_rw_status.h"
#include "EST_types.h"
#include "EST_FMatrix.h"
#include "EST_TList.h"
#include "EST_StringTrie.h"
#include "EST_simplestats.h"
#include "EST_PST.h"
#include "EST_string_aux.h"
#include "EST_math.h"
Include dependency graph for EST_Ngrammar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  EST_NgrammarState
 
class  EST_BackoffNgrammarState
 
class  EST_Ngrammar
 

Macros

#define SENTENCE_START_MARKER   "!ENTER"
 
#define SENTENCE_END_MARKER   "!EXIT"
 
#define OOV_MARKER   "!OOV"
 
#define EST_NGRAMBIN_MAGIC   1315402337
 
#define GZIP_FILENAME_EXTENSION   "gz"
 
#define COMPRESS_FILENAME_EXTENSION   "Z"
 
#define TINY_FREQ   1.0e-10
 

Functions

EST_write_status save_ngram_htk_ascii (const EST_String filename, EST_Ngrammar &n, double floor=0.0)
 
EST_write_status save_ngram_cstr_ascii (const EST_String filename, EST_Ngrammar &n, const bool trace=false, double floor=0.0)
 
EST_write_status save_ngram_cstr_bin (const EST_String filename, EST_Ngrammar &n, const bool trace=false, double floor=0.0)
 
void frequency_of_frequencies (EST_DVector &ff, EST_Ngrammar &n, int this_order=0)
 
void map_frequencies (EST_Ngrammar &n, const EST_DVector &map, const int this_order=0)
 
bool Good_Turing_smooth (EST_Ngrammar &n, int maxcount, int mincount=0)
 
void Good_Turing_discount (EST_Ngrammar &ngrammar, const int maxcount, const double default_discount=0.5)
 
void Ngram_freqsmooth (EST_Ngrammar &ngram, int smooth_thresh1, int smooth_thresh2)
 
void slide (EST_IVector &i, const int l)
 
void slide (EST_StrVector &i, const int l)
 
bool test_stats (EST_Ngrammar &ngram, const EST_String &filename, double &raw_entropy, double &count, double &entropy, double &perplexity, const EST_String &input_format, const EST_String &prev=SENTENCE_START_MARKER, const EST_String &prev_prev=SENTENCE_END_MARKER, const EST_String &last=SENTENCE_END_MARKER)
 

Macro Definition Documentation

#define SENTENCE_START_MARKER   "!ENTER"

Definition at line 59 of file EST_Ngrammar.h.

#define SENTENCE_END_MARKER   "!EXIT"

Definition at line 60 of file EST_Ngrammar.h.

#define OOV_MARKER   "!OOV"

Definition at line 61 of file EST_Ngrammar.h.

#define EST_NGRAMBIN_MAGIC   1315402337

Definition at line 63 of file EST_Ngrammar.h.

#define GZIP_FILENAME_EXTENSION   "gz"

Definition at line 66 of file EST_Ngrammar.h.

#define COMPRESS_FILENAME_EXTENSION   "Z"

Definition at line 67 of file EST_Ngrammar.h.

#define TINY_FREQ   1.0e-10

Definition at line 70 of file EST_Ngrammar.h.

Function Documentation

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

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 = false,
double  floor = 0.0 
)

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 = false,
double  floor = 0.0 
)

Definition at line 844 of file ngrammar_io.cc.

void frequency_of_frequencies ( EST_DVector ff,
EST_Ngrammar n,
int  this_order = 0 
)

Definition at line 207 of file ngrammar_aux.cc.

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

Definition at line 306 of file ngrammar_aux.cc.

bool Good_Turing_smooth ( EST_Ngrammar n,
int  maxcount,
int  mincount = 0 
)

Definition at line 410 of file ngrammar_aux.cc.

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

Definition at line 540 of file ngrammar_aux.cc.

void Ngram_freqsmooth ( EST_Ngrammar ngram,
int  smooth_thresh1,
int  smooth_thresh2 
)

Definition at line 58 of file freqsmooth.cc.

void slide ( EST_IVector i,
const int  l 
)

Definition at line 2614 of file EST_Ngrammar.cc.

void slide ( EST_StrVector i,
const int  l 
)

Definition at line 2735 of file EST_Ngrammar.cc.

bool test_stats ( EST_Ngrammar ngram,
const EST_String filename,
double &  raw_entropy,
double &  count,
double &  entropy,
double &  perplexity,
const EST_String input_format,
const EST_String prev = SENTENCE_START_MARKER,
const EST_String prev_prev = SENTENCE_END_MARKER,
const EST_String last = SENTENCE_END_MARKER 
)

Definition at line 89 of file ngrammar_utils.cc.