libsent/src/dfa/init_dfa.c File Reference

Load Grammar file into memory and setup. More...

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

Go to the source code of this file.

Functions

boolean init_dfa (DFA_INFO *dinfo, char *filename)
 Read in a grammar file and set to DFA grammar structure.
boolean make_dfa_voca_ref (DFA_INFO *dinfo, WORD_INFO *winfo)
 Make correspondence between all words in dictionary and categories in grammar, both from a word to a category and from a category to words.
void dfa_find_pause_word (DFA_INFO *dfa, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo)
 Find pause word and pause category information, and set to the grammar data.
boolean dfa_pause_word_append (DFA_INFO *dst, DFA_INFO *src, int coffset)
 Append the pause word/category information at the last.
boolean read_grammar_from_socket (int sd, DFA_INFO **ret_dfa, WORD_INFO **ret_winfo, HTK_HMM_INFO *hmminfo)
 Read grammar (DFA and dictionary) from socket and returns newly allocated grammars.


Detailed Description

Load Grammar file into memory and setup.

These functions read a grammar from file and setup for recognition process. They read a DFA grammar file, make mapping from word dictionary and find a noise category/word for pause handling.

Author:
Akinobu LEE
Date:
Tue Feb 15 14:20:43 2005
Revision
1.1.1.1

Definition in file init_dfa.c.


Function Documentation

boolean init_dfa ( DFA_INFO dinfo,
char *  filename 
)

Read in a grammar file and set to DFA grammar structure.

Parameters:
dinfo [i/o] a blank DFA data
filename [in] DFA grammar file name

Definition at line 46 of file init_dfa.c.

Referenced by multigram_read_file_and_add().

boolean make_dfa_voca_ref ( DFA_INFO dinfo,
WORD_INFO winfo 
)

Make correspondence between all words in dictionary and categories in grammar, both from a word to a category and from a category to words.

Parameters:
dinfo [i/o] DFA grammar, category information will be built here.
winfo [i/o] Word dictionary, word-to-category information will be build here.

Definition at line 74 of file init_dfa.c.

Referenced by multigram_add_words_to_grammar(), and multigram_update().

void dfa_find_pause_word ( DFA_INFO dfa,
WORD_INFO winfo,
HTK_HMM_INFO hmminfo 
)

Find pause word and pause category information, and set to the grammar data.

Parameters:
dfa [i/o] DFA grammar, sp_id and is_sp will be built here.
winfo [in] Word dictionary
hmminfo [in] HTK HMM to provide which is short pause HMM

Definition at line 107 of file init_dfa.c.

Referenced by multigram_update().

boolean dfa_pause_word_append ( DFA_INFO dst,
DFA_INFO src,
int  coffset 
)

Append the pause word/category information at the last.

Parameters:
dst [i/o] DFA grammar
src [in] DFA grammar to be appended to dst
coffset appending category point in dst

Definition at line 138 of file init_dfa.c.

Referenced by multigram_append_to_global().

boolean read_grammar_from_socket ( int  sd,
DFA_INFO **  ret_dfa,
WORD_INFO **  ret_winfo,
HTK_HMM_INFO hmminfo 
)

Read grammar (DFA and dictionary) from socket and returns newly allocated grammars.

Parameters:
sd [in] socket descpriter
ret_dfa [out] read DFA
ret_winfo [out] read dictionary
hmminfo [in] HMM definition
Returns:
TRUE on success, or FALSE on failure.

Definition at line 178 of file init_dfa.c.


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