77 #ifndef __S2_FSG_LEXTREE_H__
78 #define __S2_FSG_LEXTREE_H__
81 #include <sphinxbase/cmd_ln.h>
82 #include <sphinxbase/fsg_model.h>
94 #define FSG_PNODE_CTXT_BVSZ 2
97 uint32 bv[FSG_PNODE_CTXT_BVSZ];
174 #define fsg_pnode_leaf(p) ((p)->leaf)
175 #define fsg_pnode_logs2prob(p) ((p)->logs2prob)
176 #define fsg_pnode_succ(p) ((p)->next.succ)
177 #define fsg_pnode_fsglink(p) ((p)->next.fsglink)
178 #define fsg_pnode_sibling(p) ((p)->sibling)
179 #define fsg_pnode_hmmptr(p) (&((p)->hmm))
180 #define fsg_pnode_ci_ext(p) ((p)->ci_ext)
181 #define fsg_pnode_ppos(p) ((p)->ppos)
182 #define fsg_pnode_leaf(p) ((p)->leaf)
183 #define fsg_pnode_ctxt(p) ((p)->ctxt)
185 #define fsg_pnode_add_ctxt(p,c) ((p)->ctxt.bv[(c)>>5] |= (1 << ((c)&0x001f)))
196 #if (FSG_PNODE_CTXT_BVSZ == 1)
197 #define FSG_PNODE_CTXT_SUB(src,sub) \
198 ((src)->bv[0] = (~((sub)->bv[0]) & (src)->bv[0]))
199 #elif (FSG_PNODE_CTXT_BVSZ == 2)
200 #define FSG_PNODE_CTXT_SUB(src,sub) \
201 (((src)->bv[0] = (~((sub)->bv[0]) & (src)->bv[0])) | \
202 ((src)->bv[1] = (~((sub)->bv[1]) & (src)->bv[1])))
203 #elif (FSG_PNODE_CTXT_BVSZ == 4)
204 #define FSG_PNODE_CTXT_SUB(src,sub) \
205 (((src)->bv[0] = (~((sub)->bv[0]) & (src)->bv[0])) | \
206 ((src)->bv[1] = (~((sub)->bv[1]) & (src)->bv[1])) | \
207 ((src)->bv[2] = (~((sub)->bv[2]) & (src)->bv[2])) | \
208 ((src)->bv[3] = (~((sub)->bv[3]) & (src)->bv[3])))
210 #define FSG_PNODE_CTXT_SUB(src,sub) fsg_pnode_ctxt_sub_generic((src),(sub))
255 #define fsg_lextree_root(lt,s) ((lt)->root[s])
256 #define fsg_lextree_n_pnode(lt) ((lt)->n_pnode)
264 int32 wip, int32 pip);
void fsg_lextree_free(fsg_lextree_t *lextree)
Free lextrees for an FSG.
hmm_context_t * ctx
HMM context structure.
Building triphones for a dictionary.
void fsg_pnode_add_all_ctxt(fsg_pnode_ctxt_t *ctxt)
Set all flags on in the given context bitvector.
An individual HMM among the HMM search space.
bin_mdef_t * mdef
Model definition (triphone mappings).
uint32 fsg_pnode_ctxt_sub_generic(fsg_pnode_ctxt_t *src, fsg_pnode_ctxt_t *sub)
Generic variant for arbitrary size.
void fsg_lextree_dump(fsg_lextree_t *lextree, FILE *fp)
Print an FSG lextree to a file for debugging.
Operations on dictionary.
Implementation of HMM base structure.
void fsg_psubtree_pnode_deactivate(fsg_pnode_t *pnode)
Mark the given pnode as inactive (for search).
dict_t * dict
Pronunciation dictionary for this FSG.
Shared information between a set of HMMs.
Collection of lextrees for an FSG.
a structure for a dictionary.
int16 ** rc
Right context triphone mappings for FSG.
int16 ** lc
Left context triphone mappings for FSG.
fsg_lextree_t * fsg_lextree_init(fsg_model_t *fsg, dict_t *dict, dict2pid_t *d2p, bin_mdef_t *mdef, hmm_context_t *ctx, int32 wip, int32 pip)
Create, initialize, and return a new phonetic lextree for the given FSG.
fsg_model_t * fsg
The fsg for which this lextree is built.
Building composite triphone (as well as word internal triphones) with the dictionary.
dict2pid_t * d2p
Context-dependent phone mappings for this FSG.