#include <julius/julius.h>
Go to the source code of this file.
Functions | |
| static void | free_node_exec (NODE *node) |
| < Define if want triphone debug messages | |
| void | free_node (NODE *node) |
| Stock an unused hypothesis node for recycle. | |
| void | clear_stocker (StackDecode *s) |
| Clear the node stocker for recycle. | |
| NODE * | cpy_node (NODE *dst, NODE *src) |
| Copy the content of node to another. | |
| NODE * | newnode (RecogProcess *r) |
| Allocate a new hypothesis node. | |
| void | malloc_wordtrellis (RecogProcess *r) |
| Allocate work area for trellis computation of a word. | |
| void | free_wordtrellis () |
| Free the work area for trellis computation of a word. | |
| static LOGPROB | get_max_out_arc (HTK_HMM_Trans *tr, int state_num) |
| Get the maximum transition log probability to final state. | |
| static LOGPROB | max_out_arc (HMM_Logical *l) |
| Get the maximum transition log probability outside a phone. | |
| void | scan_word (NODE *now, HTK_Param *param, RecogProcess *r) |
| Compute the forward viterbi for the last word to update forward scores and ready for word connection. | |
| void | next_word (NODE *now, NODE *new, NEXTWORD *nword, HTK_Param *param, RecogProcess *r) |
| Connect a new word to generate a next hypothesis. | |
| void | start_word (NODE *new, NEXTWORD *nword, HTK_Param *param, RecogProcess *r) |
| Generate an initial hypothesis from given word. | |
| void | last_next_word (NODE *now, NODE *new, HTK_Param *param, RecogProcess *r) |
| Hypothesis termination: set the final sentence scores of hypothesis that has already reached to the end. | |
Variables | |
| static LOGPROB * | wordtrellis [2] |
| Buffer to compute viterbi path of a word. | |
| static int | tn |
| Temporal pointer to current buffer. | |
| static int | tl |
| Temporal pointer to previous buffer. | |
| static LOGPROB * | g |
| Buffer to hold source viterbi scores. | |
| static HMM_Logical ** | phmmseq |
| Phoneme sequence to be computed. | |
| static int | phmmlen_max |
| Maximum length of phmmseq. | |
| static boolean * | has_sp |
| Mark which phoneme allow short pause for multi-path mode. | |
| static short * | wend_token_frame [2] |
| Propagating token of word-end frame to detect corresponding end-of-words at word head. | |
| static LOGPROB * | wend_token_gscore [2] |
| Propagating token of scores at word-end to detect corresponding end-of-words at word head. | |
This file has functions for score calculations on the 2nd pass. It includes Viterbi path update calculation of a hypothesis, calculations of scores and word trellis connection at word expansion.
The cross-word triphone will be computed not at word expansion time, but at later pop up for rapid decoding. This is called "backscan" altgorithm. These functions are enabled when PASS2_STRICT_IWCD is UNDEFINED in config.h. If defined, "nextscan" functions in search_bestfirst_v2.c are used instead.
Here we use "delayed cross-word context handling" method for connection of next word and last word of the hypothesis for speeding up decoding:
This method avoid computing full context-dependency handling for all generated hypothesis in next_word(), and only re-compute it after primising ones are popped from stack later. This speeds up decoding. But since the context dependency is not considered in the total hypothesis score (computed in next_word()).
The actual implimentation:
Note that the actual implementation becomes a little more complicated to handle 1-phoneme words...
Definition in file search_bestfirst_v1.c.
| static void free_node_exec | ( | NODE * | node | ) | [static] |
< Define if want triphone debug messages
Free a hypothesis node actually.
| node | [in] hypothesis node |
Definition at line 138 of file search_bestfirst_v1.c.
Referenced by clear_stocker().
| void free_node | ( | NODE * | node | ) |
Stock an unused hypothesis node for recycle.
| node | [in] hypothesis node |
Definition at line 170 of file search_bestfirst_v1.c.
Referenced by free_all_nodes(), put_all_in_stack(), and put_to_stack().

| void clear_stocker | ( | StackDecode * | s | ) |
Clear the node stocker for recycle.
| s | [in] stack decoding work area |
Definition at line 206 of file search_bestfirst_v1.c.
Copy the content of node to another.
| dst | [out] target hypothesis | |
| src | [in] source hypothesis |
Definition at line 247 of file search_bestfirst_v1.c.
Referenced by last_next_word().

| NODE* newnode | ( | RecogProcess * | r | ) |
Allocate a new hypothesis node.
If the node stocker is not empty, the one in the stocker is re-used. Otherwise, allocate as new.
| r | [in] recognition process instance |
Definition at line 324 of file search_bestfirst_v1.c.
| void malloc_wordtrellis | ( | RecogProcess * | r | ) |
Allocate work area for trellis computation of a word.
| r | [in] recognition process instance |
Definition at line 440 of file search_bestfirst_v1.c.
| static LOGPROB get_max_out_arc | ( | HTK_HMM_Trans * | tr, | |
| int | state_num | |||
| ) | [static] |
Get the maximum transition log probability to final state.
(multipath)
| tr | [in] transition matrix | |
| state_num | [in] number of states |
Definition at line 537 of file search_bestfirst_v1.c.
Referenced by max_out_arc().
| static LOGPROB max_out_arc | ( | HMM_Logical * | l | ) | [static] |
Get the maximum transition log probability outside a phone.
(multipath)
| l | [in] phone |
Definition at line 568 of file search_bestfirst_v1.c.
Referenced by scan_word().
| void scan_word | ( | NODE * | now, | |
| HTK_Param * | param, | |||
| RecogProcess * | r | |||
| ) |
Compute the forward viterbi for the last word to update forward scores and ready for word connection.
| now | [i/o] hypothesis | |
| param | [in] input parameter vectors | |
| r | [in] recognition process instance |
Definition at line 595 of file search_bestfirst_v1.c.
| void next_word | ( | NODE * | now, | |
| NODE * | new, | |||
| NEXTWORD * | nword, | |||
| HTK_Param * | param, | |||
| RecogProcess * | r | |||
| ) |
Connect a new word to generate a next hypothesis.
The optimal connection point and new sentence score of the new hypothesis will be estimated by looking up the corresponding words on word trellis.
| now | [in] source hypothesis | |
| new | [out] pointer to save the newly generated hypothesis | |
| nword | [in] next word to be connected | |
| param | [in] input parameter vector | |
| r | [in] recognition process instance |
Definition at line 1393 of file search_bestfirst_v1.c.
| void start_word | ( | NODE * | new, | |
| NEXTWORD * | nword, | |||
| HTK_Param * | param, | |||
| RecogProcess * | r | |||
| ) |
Generate an initial hypothesis from given word.
| new | [out] pointer to save the newly generated hypothesis | |
| nword | [in] words of the first candidates | |
| param | [in] input parameter vector | |
| r | [in] recognition process instance |
Definition at line 1625 of file search_bestfirst_v1.c.
| void last_next_word | ( | NODE * | now, | |
| NODE * | new, | |||
| HTK_Param * | param, | |||
| RecogProcess * | r | |||
| ) |
Hypothesis termination: set the final sentence scores of hypothesis that has already reached to the end.
| now | [in] hypothesis that has already reached to the end | |
| new | [out] pointer to save the final sentence information | |
| param | [in] input parameter vectors | |
| r | [in] recognition process instance |
Definition at line 1719 of file search_bestfirst_v1.c.
1.5.4