42 #ifndef __PS_LATTICE_INTERNAL_H__ 43 #define __PS_LATTICE_INTERNAL_H__ 165 ngram_model_t *lmset;
254 ngram_model_t *lmset,
ps_astar_t * ps_astar_start(ps_lattice_t *dag, ngram_model_t *lmset, float32 lwf, int sf, int ef, int w1, int w2)
Begin N-Gram based A* search on a word graph.
ps_lattice_t * ps_lattice_init_search(ps_search_t *search, int n_frame)
Construct an empty word graph with reference to a search structure.
void ps_lattice_delq(ps_lattice_t *dag)
Clear and reset the traversal queue.
listelem_alloc_t * latlink_list_alloc
List element allocator for this DAG.
Base structure for search module.
int32 n_nodes
Number of nodes in this lattice.
logmath_t * lmath
Log-math object.
int32 fanin
Number nodes with links to this node.
frame_idx_t ef
Ending frame of this word.
int32 id
Unique id for this node.
ps_seg_t base
Base structure.
glist_t hyps
List of hypothesis strings.
ps_latnode_t * start
Starting node.
ps_latlink_t ** links
Array of lattice links.
latlink_list_t * q_head
Queue of links for traversal.
void ps_lattice_penalize_fillers(ps_lattice_t *dag, int32 silpen, int32 fillpen)
Insert penalty for fillers.
ps_search_t * search
Search (if generated by search).
struct ps_latnode_s * from
From node.
frame_idx_t n_frames
Number of frames for this utterance.
struct ps_astar_s ps_astar_t
A* search structure.
char const * ps_astar_hyp(ps_astar_t *nbest, ps_latpath_t *path)
Get hypothesis string from A* search.
ps_latnode_t * nodes
List of all nodes.
listelem_alloc_t * latnode_alloc
Node allocator for this DAG.
latlink_list_t * latlink_list_new(ps_lattice_t *dag, ps_latlink_t *link, latlink_list_t *next)
Create a new lattice link element.
int32 best_exit
Best exit score (used for final nodes only)
int32 alpha
Forward probability of this link P(w,o_1^{ef})
latlink_list_t * entries
Links into this node.
struct ps_latnode_s * alt
Node with alternate pronunciation for this word.
int32 final_node_ascr
Acoustic score of implicit link exiting final node.
ps_seg_t * ps_lattice_seg_iter(ps_lattice_t *dag, ps_latlink_t *link, float32 lwf)
Get hypothesis segmentation iterator after bestpath search.
struct ps_latpath_s * next
Pointer to next path in list of paths.
struct dag_seg_s dag_seg_t
Segmentation "iterator" for backpointer table results.
struct ps_latpath_s * parent
Previous element in this path.
int16 n_links
Number of lattice links.
ps_latnode_t * end
Ending node.
frame_idx_t sf
Start frame.
glist_t velist
List of history entries with different lmstate (tst only)
latlink_list_t * exits
Links out of this node.
int32 silence
Silence word ID.
char const * ps_lattice_hyp(ps_lattice_t *dag, ps_latlink_t *link)
Get hypothesis string after bestpath search.
dict_t * dict
Dictionary for this DAG.
listelem_alloc_t * latpath_alloc
Path allocator for N-best search.
int32 beta
Backward probability of this link P(w|o_{ef+1}^T)
listelem_alloc_t * latlink_alloc
Link allocator for this DAG.
int32 path_scr
Best path score from root of DAG.
int32 wid
Dictionary word id.
int32 node_id
Node from fsg model, used to map lattice back to model.
a structure for a dictionary.
void ps_lattice_delete_unreachable(ps_lattice_t *dag)
Remove nodes marked as unreachable.
Word graph structure used in bestpath/nbest search.
int32 norm
Normalizer for posterior probabilities.
Segmentation "iterator" for A* search results.
int refcount
Reference count.
struct ps_latpath_s ps_latpath_t
Partial path structure used in N-best (A*) search.
latlink_list_t * q_tail
Queue of links for traversal.
int32 ascr
Score for from->wid (from->sf to this->ef)
int16 cur
Current position in bpidx.
void ps_lattice_pushq(ps_lattice_t *dag, ps_latlink_t *link)
Add an edge to the traversal queue.
Partial path structure used in N-best (A*) search.
Segmentation "iterator" for backpointer table results.
int32 frame_idx_t
Type for frame index values.
int32 fef
First end frame.
ps_latlink_t * ps_lattice_popq(ps_lattice_t *dag)
Remove an edge from the traversal queue.
int32 norm
Normalizer for posterior probabilities.
int32 basewid
Dictionary base word id.
ps_latpath_t * ps_astar_next(ps_astar_t *nbest)
Find next best hypothesis of A* on a word graph.
Linked list of DAG link pointers.
struct ps_latnode_s * next
Next node in DAG (no ordering implied)
struct astar_seg_s astar_seg_t
Segmentation "iterator" for A* search results.
int32 rem_score
Estimated best score from node.sf to end.
ps_seg_t * ps_astar_seg_iter(ps_astar_t *astar, ps_latpath_t *path, float32 lwf)
Get hypothesis segmentation from A* search.
char * hyp_str
Current hypothesis string.
Base structure for hypothesis segmentation iterator.
ps_latnode_t * node
Node ending this path.
int32 score
Exact score from start node up to node->sf.
struct latlink_list_s latlink_list_t
Linked list of DAG link pointers.
void ps_astar_finish(ps_astar_t *nbest)
Finish N-best search, releasing resources associated with it.
struct ps_latnode_s * to
To node.