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