00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __S2_FSG_SEARCH_H__
00041 #define __S2_FSG_SEARCH_H__
00042
00043
00044
00045 #include <glist.h>
00046 #include <cmd_ln.h>
00047 #include <fsg_model.h>
00048
00049
00050 #include "pocketsphinx_internal.h"
00051 #include "hmm.h"
00052 #include "fsg_history.h"
00053 #include "fsg_lextree.h"
00054
00058 typedef struct fsg_seg_s {
00059 ps_seg_t base;
00060 fsg_hist_entry_t **hist;
00061 int16 n_hist;
00062 int16 cur;
00063 } fsg_seg_t;
00064
00068 typedef struct fsg_search_s {
00069 ps_search_t base;
00070
00071 hmm_context_t *hmmctx;
00073 hash_table_t *fsgs;
00074 fsg_model_t *fsg;
00077 jsgf_t *jsgf;
00078 struct fsg_lextree_s *lextree;
00080 struct fsg_history_s *history;
00082 glist_t pnode_active;
00083 glist_t pnode_active_next;
00085 int32 beam_orig;
00086 int32 pbeam_orig;
00087 int32 wbeam_orig;
00088 float32 beam_factor;
00091 int32 beam, pbeam, wbeam;
00092 int32 lw, pip, wip;
00094 int16 frame;
00095 uint8 final;
00096 uint8 bestpath;
00098 float32 ascale;
00100 int32 bestscore;
00101 int32 bpidx_start;
00103 int32 ascr, lscr;
00105 int32 n_hmm_eval;
00106 int32 n_sen_eval;
00107 } fsg_search_t;
00108
00109
00110 #define fsg_search_frame(s) ((s)->frame)
00111
00115 ps_search_t *fsg_search_init(cmd_ln_t *config,
00116 acmod_t *acmod,
00117 dict_t *dict,
00118 dict2pid_t *d2p);
00119
00123 void fsg_search_free(ps_search_t *search);
00124
00128 int fsg_search_reinit(ps_search_t *fsgs, dict_t *dict, dict2pid_t *d2p);
00129
00134 int fsg_search_start(ps_search_t *search);
00135
00139 int fsg_search_step(ps_search_t *search, int frame_idx);
00140
00144 int fsg_search_finish(ps_search_t *search);
00145
00149 char const *fsg_search_hyp(ps_search_t *search, int32 *out_score);
00150
00151 #endif