44#ifndef __POCKETSPHINX_INTERNAL_H__
45#define __POCKETSPHINX_INTERNAL_H__
48#include <sphinxbase/cmd_ln.h>
49#include <sphinxbase/fe.h>
50#include <sphinxbase/feat.h>
51#include <sphinxbase/hash_table.h>
52#include <sphinxbase/logmath.h>
53#include <sphinxbase/profile.h>
68#define PS_DEFAULT_SEARCH "_default"
69#define PS_DEFAULT_PL_SEARCH "_default_pl"
72#define PS_SEARCH_TYPE_KWS "kws"
73#define PS_SEARCH_TYPE_FSG "fsg"
74#define PS_SEARCH_TYPE_NGRAM "ngram"
75#define PS_SEARCH_TYPE_ALLPHONE "allphone"
76#define PS_SEARCH_TYPE_STATE_ALIGN "state_align"
77#define PS_SEARCH_TYPE_PHONE_LOOP "phone_loop"
90 char const *(*hyp)(
ps_search_t *search, int32 *out_score);
122#define ps_search_base(s) ((ps_search_t *)s)
123#define ps_search_config(s) ps_search_base(s)->config
124#define ps_search_acmod(s) ps_search_base(s)->acmod
125#define ps_search_dict(s) ps_search_base(s)->dict
126#define ps_search_dict2pid(s) ps_search_base(s)->d2p
127#define ps_search_dag(s) ps_search_base(s)->dag
128#define ps_search_last_link(s) ps_search_base(s)->last_link
129#define ps_search_post(s) ps_search_base(s)->post
130#define ps_search_lookahead(s) ps_search_base(s)->pls
131#define ps_search_n_words(s) ps_search_base(s)->n_words
133#define ps_search_type(s) ps_search_base(s)->type
134#define ps_search_name(s) ps_search_base(s)->name
135#define ps_search_start(s) (*(ps_search_base(s)->vt->start))(s)
136#define ps_search_step(s,i) (*(ps_search_base(s)->vt->step))(s,i)
137#define ps_search_finish(s) (*(ps_search_base(s)->vt->finish))(s)
138#define ps_search_reinit(s,d,d2p) (*(ps_search_base(s)->vt->reinit))(s,d,d2p)
139#define ps_search_free(s) (*(ps_search_base(s)->vt->free))(s)
140#define ps_search_lattice(s) (*(ps_search_base(s)->vt->lattice))(s)
141#define ps_search_hyp(s,sc) (*(ps_search_base(s)->vt->hyp))(s,sc)
142#define ps_search_prob(s) (*(ps_search_base(s)->vt->prob))(s)
143#define ps_search_seg_iter(s) (*(ps_search_base(s)->vt->seg_iter))(s)
146#define ps_search_silence_wid(s) ps_search_base(s)->silence_wid
147#define ps_search_start_wid(s) ps_search_base(s)->start_wid
148#define ps_search_finish_wid(s) ps_search_base(s)->finish_wid
154 const char *type,
const char *name,
194#define ps_search_seg_next(seg) (*(seg->vt->seg_next))(seg)
195#define ps_search_seg_free(s) (*(seg->vt->seg_free))(seg)
Acoustic model structures for PocketSphinx.
Building triphones for a dictionary.
Operations on dictionary.
int32 frame_idx_t
Type for frame index values.
Main header file for the PocketSphinx decoder.
struct ps_searchfuncs_s ps_searchfuncs_t
V-table for search algorithm.
void ps_search_base_reinit(ps_search_t *search, dict_t *dict, dict2pid_t *d2p)
Re-initialize base structure with new dictionary.
void ps_search_base_free(ps_search_t *search)
Free search.
void ps_search_init(ps_search_t *search, ps_searchfuncs_t *vt, const char *type, const char *name, cmd_ln_t *config, acmod_t *acmod, dict_t *dict, dict2pid_t *d2p)
Initialize base structure.
Acoustic model structure.
Building composite triphone (as well as word internal triphones) with the dictionary.
a structure for a dictionary.
cmd_ln_t * config
Configuration.
ps_search_t * phone_loop
Phone loop search for lookahead.
char const * senlogdir
Log directory for senone score files.
int pl_window
Window size for phoneme lookahead.
uint32 uttno
Utterance counter.
uint32 n_frame
Total number of frames processed.
hash_table_t * searches
Set of search modules.
char const * mfclogdir
Log directory for MFCC files.
char const * rawlogdir
Log directory for audio files.
int refcount
Reference count.
ptmr_t perf
Performance counter for all of decoding.
logmath_t * lmath
Log math computation.
ps_search_t * search
Currently active search module.
dict2pid_t * d2p
Dictionary to senone mapping.
dict_t * dict
Pronunciation dictionary.
acmod_t * acmod
Acoustic model.
Word graph structure used in bestpath/nbest search.
Base structure for search module.
int32 finish_wid
Finish word ID.
acmod_t * acmod
Acoustic model.
ps_search_t * pls
Phoneme loop for lookahead.
int32 post
Utterance posterior probability.
dict2pid_t * d2p
Dictionary to senone mappings.
ps_lattice_t * dag
Current hypothesis word graph.
dict_t * dict
Pronunciation dictionary.
ps_latlink_t * last_link
Final link in best path.
char * hyp_str
Current hypothesis string.
ps_searchfuncs_t * vt
V-table of search methods.
cmd_ln_t * config
Configuration.
int32 silence_wid
Silence word ID.
int32 n_words
Number of words known to search (may be less than in the dictionary)
int32 start_wid
Start word ID.
V-table for search algorithm.
Base structure for hypothesis segmentation iterator.
ps_search_t * search
Search object from whence this came.
float32 lwf
Language weight factor (for second-pass searches)
int32 lback
Language model backoff.
ps_segfuncs_t * vt
V-table of seg methods.
int32 lscr
Language model score.
int32 ascr
Acoustic score.
frame_idx_t sf
Start frame.
char const * word
Word string (pointer into dictionary hash)
int32 prob
Log posterior probability.