#include <mdef.h>
#include <mmio.h>
#include <cmd_ln.h>
Go to the source code of this file.
Data Structures | |
struct | mdef_entry_s |
struct | cd_tree_s |
struct | bin_mdef_s |
Defines | |
#define | BIN_MDEF_FORMAT_VERSION 1 |
#define | BIN_MDEF_NATIVE_ENDIAN 0x46444d42 |
#define | BIN_MDEF_OTHER_ENDIAN 0x424d4446 |
#define | ATTRIBUTE_PACKED |
#define | bin_mdef_is_fillerphone(m, p) |
#define | bin_mdef_is_ciphone(m, p) ((p) < (m)->n_ciphone) |
#define | bin_mdef_n_ciphone(m) ((m)->n_ciphone) |
#define | bin_mdef_n_phone(m) ((m)->n_phone) |
#define | bin_mdef_n_sseq(m) ((m)->n_sseq) |
#define | bin_mdef_n_emit_state(m) ((m)->n_emit_state) |
#define | bin_mdef_n_emit_state_phone(m, p) |
#define | bin_mdef_n_sen(m) ((m)->n_sen) |
#define | bin_mdef_n_tmat(m) ((m)->n_tmat) |
#define | bin_mdef_pid2ssid(m, p) ((m)->phone[p].ssid) |
#define | bin_mdef_pid2tmatid(m, p) ((m)->phone[p].tmat) |
#define | bin_mdef_silphone(m) ((m)->sil) |
#define | bin_mdef_sseq2sen(m, ss, pos) ((m)->sseq[ss][pos]) |
#define | bin_mdef_pid2ci(m, p) |
Typedefs | |
typedef struct mdef_entry_s | mdef_entry_t |
Phone entry (on-disk, 12 bytes). | |
typedef struct cd_tree_s | cd_tree_t |
Node in CD phone tree (on-disk, 8 bytes). | |
typedef struct bin_mdef_s | bin_mdef_t |
Model definition structure (in-memory). | |
Functions | |
bin_mdef_t * | bin_mdef_read (cmd_ln_t *config, const char *filename) |
Read a binary mdef from a file. | |
bin_mdef_t * | bin_mdef_read_text (cmd_ln_t *config, const char *filename) |
Read a text mdef from a file (creating an in-memory binary mdef). | |
int | bin_mdef_write (bin_mdef_t *m, const char *filename) |
Write a binary mdef to a file. | |
int | bin_mdef_write_text (bin_mdef_t *m, const char *filename) |
Write a binary mdef to a text file. | |
void | bin_mdef_free (bin_mdef_t *m) |
Free a binary mdef. | |
int | bin_mdef_ciphone_id (bin_mdef_t *m, const char *ciphone) |
Context-independent phone lookup. | |
int | bin_mdef_ciphone_id_nocase (bin_mdef_t *m, const char *ciphone) |
Case-insensitive context-independent phone lookup. | |
const char * | bin_mdef_ciphone_str (bin_mdef_t *m, int32 ci) |
int | bin_mdef_phone_id (bin_mdef_t *m, int32 b, int32 l, int32 r, int32 pos) |
int | bin_mdef_phone_str (bin_mdef_t *m, int pid, char *buf) |
Create a phone string for the given phone (base or triphone) id in the given buf. | |
Variables | |
struct mdef_entry_s | ATTRIBUTE_PACKED |
Definition in file bin_mdef.h.
#define bin_mdef_is_fillerphone | ( | m, | |||
p | ) |
Value:
(((p) < (m)->n_ciphone) \ ? (m)->phone[p].info.ci.filler \ : (m)->phone[(m)->phone[p].info.cd.ctx[0]].info.ci.filler)
Definition at line 136 of file bin_mdef.h.
#define bin_mdef_n_emit_state_phone | ( | m, | |||
p | ) |
Value:
((m)->n_emit_state ? (m)->n_emit_state \ : (m)->sseq_len[(m)->phone[p].ssid])
Definition at line 144 of file bin_mdef.h.
#define bin_mdef_pid2ci | ( | m, | |||
p | ) |
Value:
(((p) < (m)->n_ciphone) ? (p) \ : (m)->phone[p].info.cd.ctx[0])
Definition at line 152 of file bin_mdef.h.
int bin_mdef_ciphone_id | ( | bin_mdef_t * | m, | |
const char * | ciphone | |||
) |
Context-independent phone lookup.
Definition at line 658 of file bin_mdef.c.
int bin_mdef_ciphone_id_nocase | ( | bin_mdef_t * | m, | |
const char * | ciphone | |||
) |
Case-insensitive context-independent phone lookup.
Definition at line 681 of file bin_mdef.c.
void bin_mdef_free | ( | bin_mdef_t * | m | ) |
int bin_mdef_phone_str | ( | bin_mdef_t * | m, | |
int | pid, | |||
char * | buf | |||
) |
Create a phone string for the given phone (base or triphone) id in the given buf.
Definition at line 781 of file bin_mdef.c.
References WPOS_NAME.
bin_mdef_t* bin_mdef_read | ( | cmd_ln_t * | config, | |
const char * | filename | |||
) |
Read a binary mdef from a file.
Definition at line 288 of file bin_mdef.c.
References S3_SILENCE_CIPHONE.
bin_mdef_t* bin_mdef_read_text | ( | cmd_ln_t * | config, | |
const char * | filename | |||
) |
Read a text mdef from a file (creating an in-memory binary mdef).
Definition at line 66 of file bin_mdef.c.
References mdef_t::cd2cisen, phone_t::ci, mdef_t::ciphone, ciphone_t::filler, phone_t::lc, acmod_s::mdef, mdef_init(), mdef_t::n_ci_sen, mdef_t::n_ciphone, mdef_t::n_emit_state, mdef_t::n_phone, mdef_t::n_sen, mdef_t::n_sseq, mdef_t::n_tmat, N_WORD_POSN, ciphone_t::name, mdef_t::phone, phone_t::rc, mdef_t::sen2cimap, mdef_t::sil, mdef_t::sseq, phone_t::ssid, phone_t::tmat, phone_t::wpos, mdef_t::wpos_ci_lclist, and WPOS_NAME.
int bin_mdef_write | ( | bin_mdef_t * | m, | |
const char * | filename | |||
) |
int bin_mdef_write_text | ( | bin_mdef_t * | m, | |
const char * | filename | |||
) |
Write a binary mdef to a text file.
Definition at line 573 of file bin_mdef.c.
References WPOS_NAME.