libsent/src/voca/voca_load_wordlist.c File Reference

Read word list from a file for isolated word recognition mode. More...

#include <sent/stddefs.h>
#include <sent/vocabulary.h>
#include <sent/htk_hmm.h>

Go to the source code of this file.

Defines

#define PHONEMELEN_STEP   30
 Memory allocation step for phoneme sequence.

Functions

static void add_to_error (WORD_INFO *winfo, char *name)
 Add a triphone name to the missing error list in WORD_INFO.
static void callback_list_error (void *x)
 Traverse callback function to output a error phone.
static void list_error (WORD_INFO *winfo)
 Output all error phones appeared while readin a word dictionary.
boolean voca_load_word_line (char *buf, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo, char *headphone, char *tailphone, char *contextphone)
 Load a line from buffer and set parameters to the dictionary.
boolean voca_load_wordlist (FILE *fp, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo, char *headphone, char *tailphone, char *contextphone)
 Top function to read word list via file pointer.
boolean voca_load_wordlist_line (char *buf, WORD_ID *vnum_p, int linenum, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo, boolean do_conv, boolean *ok_flag, char *headphone, char *tailphone, char *contextphone)
 Sub function to Add a dictionary entry line to the word dictionary.

Variables

static char buf [MAXLINELEN]
 Local work area for input text processing.
static char bufbak [MAXLINELEN]
 Local work area for debug message.


Detailed Description

Read word list from a file for isolated word recognition mode.

Author:
Akinobu LEE
Date:
Sun Jul 22 13:29:32 2007
Revision
1.1.1.1

Definition in file voca_load_wordlist.c.


Function Documentation

static void add_to_error ( WORD_INFO winfo,
char *  name 
) [static]

Add a triphone name to the missing error list in WORD_INFO.

Parameters:
winfo [i/o] word dictionary to add the error phone to error list
name [in] phone name to be added

Definition at line 56 of file voca_load_wordlist.c.

static void callback_list_error ( void *  x  )  [static]

Traverse callback function to output a error phone.

Parameters:
x [in] error phone string of the node

Definition at line 79 of file voca_load_wordlist.c.

static void list_error ( WORD_INFO winfo  )  [static]

Output all error phones appeared while readin a word dictionary.

Parameters:
winfo [in] word dictionary data

Definition at line 91 of file voca_load_wordlist.c.

boolean voca_load_word_line ( char *  buf,
WORD_INFO winfo,
HTK_HMM_INFO hmminfo,
char *  headphone,
char *  tailphone,
char *  contextphone 
)

Load a line from buffer and set parameters to the dictionary.

Parameters:
buf [in] input buffer containing a word entry
winfo [i/o] word dictionary to append the entry
hmminfo [in] phoneme HMM definition
headphone [in] word head silence model name
tailphone [in] word tail silence model name
contextphone [in] silence context name to be used at head and tail
Returns:
TRUE when successfully read, or FALSE on encountered end of dictionary. When an error occurs, this function will set winfo->ok_flag to FALSE.

Definition at line 114 of file voca_load_wordlist.c.

Referenced by voca_load_wordlist().

boolean voca_load_wordlist ( FILE *  fp,
WORD_INFO winfo,
HTK_HMM_INFO hmminfo,
char *  headphone,
char *  tailphone,
char *  contextphone 
)

Top function to read word list via file pointer.

Parameters:
fp [in] file pointer
winfo [out] pointer to word dictionary to store the read data.
hmminfo [in] HTK HMM definition data. if NULL, phonemes are ignored.
headphone [in] word head silence model name
tailphone [in] word tail silence model name
contextphone [in] silence context name to be used at head and tail
Returns:
TRUE on success, FALSE on any error word.

Definition at line 142 of file voca_load_wordlist.c.

Referenced by init_wordlist().

boolean voca_load_wordlist_line ( char *  buf,
WORD_ID vnum_p,
int  linenum,
WORD_INFO winfo,
HTK_HMM_INFO hmminfo,
boolean  do_conv,
boolean *  ok_flag,
char *  headphone,
char *  tailphone,
char *  contextphone 
)

Sub function to Add a dictionary entry line to the word dictionary.

Parameters:
buf [i/o] buffer to hold the input string, will be modified in this function
vnum_p [in] current number of words in winfo
linenum [in] current line number of the input
winfo [out] pointer to word dictionary to append the data.
hmminfo [in] HTK HMM definition data. if NULL, phonemes are ignored.
do_conv [in] TRUE if performing triphone conversion
ok_flag [out] will be set to FALSE if an error occured for this input.
headphone [in] word head silence model name
tailphone [in] word tail silence model name
contextphone [in] silence context name to be used at head and tail
Returns:
FALSE if buf == "DICEND", else TRUE will be returned.

Definition at line 172 of file voca_load_wordlist.c.

Referenced by voca_load_word_line().


Generated on Tue Dec 18 16:01:41 2007 for Julius by  doxygen 1.5.4