58 #include <sphinxbase/hash_table.h>
80 #define WPOS_NAME "ibesu"
81 #define S3_SILENCE_CIPHONE "SIL"
165 #define mdef_is_fillerphone(m,p) ((m)->ciphone[p].filler)
166 #define mdef_n_ciphone(m) ((m)->n_ciphone)
167 #define mdef_n_phone(m) ((m)->n_phone)
168 #define mdef_n_sseq(m) ((m)->n_sseq)
169 #define mdef_n_emit_state(m) ((m)->n_emit_state)
170 #define mdef_n_sen(m) ((m)->n_sen)
171 #define mdef_n_tmat(m) ((m)->n_tmat)
172 #define mdef_pid2ssid(m,p) ((m)->phone[p].ssid)
173 #define mdef_pid2tmatid(m,p) ((m)->phone[p].tmat)
174 #define mdef_silphone(m) ((m)->sil)
175 #define mdef_sen2cimap(m) ((m)->sen2cimap)
176 #define mdef_sseq2sen(m,ss,pos) ((m)->sseq[ss][pos])
177 #define mdef_pid2ci(m,p) ((m)->phone[p].ci)
178 #define mdef_cd2cisen(m) ((m)->cd2cisen)
The main model definition structure.
int32 n_ciphone
number basephones actually present
struct ph_lc_s * next
Next lc entry for same parent
word_posn_t wpos
Word position.
int32 filler
Whether a filler phone; if so, can be substituted by silence phone in left or right context position...
int32 n_phone
number basephones + number triphones actually present
int16 rc
Base, left, right context ciphones.
int mdef_is_ciphone(mdef_t *m, int p)
Decide whether the phone is ci phone.
char * name
The name of the CI phone.
int16 * cd2cisen
Parent CI-senone id for each senone; the first n_ci_sen are identity mappings; the CD-senones are con...
void mdef_free(mdef_t *mdef)
Free an mdef_t.
int32 n_ci_sen
number CI senones; these are the first
int32 ssid
State sequence (or senone sequence) ID, considering the n_emit_state senone-ids are a unit...
void mdef_report(mdef_t *m)
Report the model definition's parameters.
Structures for storing the left context.
int16 lc
Specific lc for a parent
int mdef_hmm_cmp(mdef_t *m, int p1, int p2)
Compare the underlying HMMs for two given phones (i.e., compare the two transition matrix IDs and the...
int mdef_phone_str(mdef_t *m, int pid, char *buf)
Create a phone string for the given phone (base or triphone) id in the given buf. ...
int16 rc
Specific rc for a parent
uint16 ** sseq
Unique state (or senone) sequences in this model, shared among all phones/triphones.
int32 pid
Triphone id for above rc instance.
Undefined value, used for initial conditions, etc.
mdef_t * mdef_init(char *mdeffile, int breport)
Initialize the phone structure from the given model definition file.
Triphone information, including base phones as a subset.
ph_rc_t * rclist
rc list for above lc instance
const char * mdef_ciphone_str(mdef_t *m, int ci)
Get the phone string given the ci phone id.
int mdef_phone_id(mdef_t *m, int b, int l, int r, word_posn_t pos)
Decide the phone id given the left, right and base phones.
ciphone_t * ciphone
CI-phone information for all ciphones.
hash_table_t * ciphone_ht
Hash table for mapping ciphone strings to ids.
void mdef_free_recursive_lc(ph_lc_t *lc)
RAH, For freeing memory.
int32 n_sen
number senones (CI+CD)
int32 tmat
Transition matrix id.
int mdef_ciphone_id(mdef_t *m, char *ciphone)
Get the ciphone id given a string name.
int16 * sen2cimap
Parent CI-phone for each senone (CI or CD)
struct ph_rc_s * next
Next rc entry for same parent
int32 n_tmat
number transition matrices
int mdef_is_cisenone(mdef_t *m, int s)
Decide whether the senone is a senone for a ci phone, or a ci senone.
word_posn_t
Union of different type of word position.
int32 n_emit_state
number emitting states per phone
int16 sil
SILENCE_CIPHONE id.
ph_lc_t *** wpos_ci_lclist
wpos_ci_lclist[wpos][ci] = list of lc for .
Structures needed for mapping into pid.
void mdef_free_recursive_rc(ph_rc_t *rc)
phone_t * phone
Information for all ciphones and triphones.