libsent/include/sent/dfa.h

決定性有限状態オートマトン文法(DFA)およびカテゴリ対情報の構造体定義 [詳細]

#include <sent/stddefs.h>
#include <sent/vocabulary.h>
#include <sent/htk_hmm.h>
dfa.hのインクルード依存関係図
このグラフは、どのファイルから直接、間接的にインクルードされているかを示しています。

ソースコードを見る。

データ構造

struct  _dfa_arc
 Transition arc of DFA. [詳細]
struct  DFA_STATE
 State of DFA. [詳細]
struct  TERM_INFO
 Information of each terminal symbol (=category). [詳細]
struct  DFA_INFO
 Top structure of a DFA. [詳細]

マクロ定義

#define DFA_STATESTEP   1000
 Allocation step of DFA state.
#define INITIAL_S   0x10000000
 Status flag mask specifying an initial state.
#define ACCEPT_S   0x00000001
 Status flag mask specifying an accept state.

型定義

typedef struct _dfa_arc DFA_ARC
 Transition arc of DFA.

関数

DFA_INFOdfa_info_new ()
void dfa_info_free (DFA_INFO *dfa)
void dfa_state_init (DFA_INFO *dinfo)
void dfa_state_expand (DFA_INFO *dinfo, int needed)
boolean rddfa (FILE *fp, DFA_INFO *dinfo)
boolean rddfa_fd (int fd, DFA_INFO *dinfo)
boolean rddfa_sd (int sd, DFA_INFO *dinfo)
boolean rddfa_line (char *line, DFA_INFO *dinfo, int *state_max, int *arc_num, int *terminal_max)
void dfa_append (DFA_INFO *dst, DFA_INFO *src, int soffset, int coffset)
void init_dfa (DFA_INFO *dinfo, char *filename)
WORD_ID dfa_symbol_lookup (DFA_INFO *dinfo, char *terminalname)
void extract_cpair (DFA_INFO *dinfo)
void cpair_append (DFA_INFO *dst, DFA_INFO *src, int coffset)
void print_dfa_info (DFA_INFO *dinfo)
void print_dfa_cp (DFA_INFO *dinfo)
boolean dfa_cp (DFA_INFO *dfa, int i, int j)
boolean dfa_cp_begin (DFA_INFO *dfa, int i)
boolean dfa_cp_end (DFA_INFO *dfa, int i)
void set_dfa_cp (DFA_INFO *dfa, int i, int j, boolean value)
void set_dfa_cp_begin (DFA_INFO *dfa, int i, boolean value)
void set_dfa_cp_end (DFA_INFO *dfa, int i, boolean value)
void init_dfa_cp (DFA_INFO *dfa)
void malloc_dfa_cp (DFA_INFO *dfa, int term_num)
void realloc_dfa_cp (DFA_INFO *dfa, int old_term_num, int new_term_num)
void free_dfa_cp (DFA_INFO *dfa)
void make_dfa_voca_ref (DFA_INFO *dinfo, WORD_INFO *winfo)
void make_terminfo (TERM_INFO *tinfo, DFA_INFO *dinfo, WORD_INFO *winfo)
void terminfo_append (TERM_INFO *dst, TERM_INFO *src, int coffset, int woffset)
void dfa_find_pause_word (DFA_INFO *dfa, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo)
void dfa_pause_word_append (DFA_INFO *dst, DFA_INFO *src, int coffset)

説明

決定性有限状態オートマトン文法(DFA)およびカテゴリ対情報の構造体定義

作者:
Akinobu LEE
日付:
Thu Feb 10 18:21:27 2005

このファイルには, DFAと呼ばれる有限状態文法の構造体が定義されています.

DFAは, 単語のカテゴリ番号を入力とする決定性オートマトンで,構文制約を 表現します.カテゴリごとの単語リストも保持します.

また,第1パスの認識のために,DFAカテゴリ間の接続関係のみを抜き出した 単語対情報も保持します.これは文法を読みだし後に内部でDFAから抽出されます.

Revision
1.3

dfa.h で定義されています。


関数

DFA_INFO* dfa_info_new (  ) 

Allocate a new grammar information data structure and initialize it.

戻り値:
pointer to the newly allocated DFA_INFO.

dfa_malloc.c33 行で定義されています。

参照元 multigram_exec(), と multigram_read_file().

void dfa_info_free ( DFA_INFO dfa  ) 

Free all informations in the DFA_INFO.

引数:
dfa [i/o] grammar information data to be freed.

dfa_malloc.c54 行で定義されています。

参照元 multigram_exec(), と multigram_exec_delete().

void dfa_state_init ( DFA_INFO dinfo  ) 

Initialize and allocate DFA state information list in the grammar.

引数:
dinfo [i/o] DFA grammar

rddfa.c35 行で定義されています。

参照元 multigram_exec(), rddfa(), rddfa_fd(), と rddfa_sd().

void dfa_state_expand ( DFA_INFO dinfo,
int  needed 
)

Expand the state information list to the required length.

引数:
dinfo [i/o] DFA grammar
needed [in] required new length

rddfa.c56 行で定義されています。

参照元 dfa_append(), と rddfa_line().

boolean rddfa ( FILE *  fp,
DFA_INFO dinfo 
)

Top loop function to read DFA grammar via file pointer

引数:
fp [in] file pointer that points to the DFA grammar data
dinfo [out] the read data will be stored in this DFA grammar structure
戻り値:
TRUE on success, FALSE on failure.

rddfa.c79 行で定義されています。

参照元 init_dfa().

boolean rddfa_fd ( int  fd,
DFA_INFO dinfo 
)

Top loop function to read DFA grammar via file descriptor

引数:
fd [in] file descriptor that points to the DFA grammar data
dinfo [out] the read data will be stored in this DFA grammar structure
戻り値:
TRUE on success, FALSE on failure.

rddfa.c109 行で定義されています。

boolean rddfa_sd ( int  sd,
DFA_INFO dinfo 
)

Top loop function to read DFA grammar via socket descriptor

引数:
sd [in] socket descriptor that points to the DFA grammar data
dinfo [out] the read data will be stored in this DFA grammar structure
戻り値:
TRUE on success, FALSE on failure.

rddfa.c139 行で定義されています。

boolean rddfa_line ( char *  line,
DFA_INFO dinfo,
int *  state_max,
int *  arc_num,
int *  terminal_max 
)

Parse the input line and set grammar information, one by line.

引数:
line [in] text buffer that holds a line of DFA file
dinfo [i/o] the read data will be appended to this DFA data
state_max [i/o] maximum number of state id appeared, will be updated
arc_num [i/o] number of read arcs, will be updated
terminal_max [i/o] maximum number of state id appended, will be updated
戻り値:
TRUE if the line was successfully parsed, FALSE if failed.

rddfa.c172 行で定義されています。

参照元 rddfa(), rddfa_fd(), と rddfa_sd().

void dfa_append ( DFA_INFO dst,
DFA_INFO src,
int  soffset,
int  coffset 
)

Append the DFA state information to other

引数:
dst [i/o] DFA grammar
src [i/o] DFA grammar to be appended to dst
soffset [in] offset state number in dst where the new state should be stored
coffset [in] category id offset in dst where the new data should be stored

rddfa.c230 行で定義されています。

参照元 multigram_build_append().

void init_dfa ( DFA_INFO dinfo,
char *  filename 
)

Read in a grammar file and set to DFA grammar structure

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

init_dfa.c45 行で定義されています。

参照元 multigram_read_file().

WORD_ID dfa_symbol_lookup ( DFA_INFO dinfo,
char *  terminalname 
)

Return category id corresponding to the given terminal name. Actually they are mere strings of ID itself.

引数:
dinfo [in] DFA grammar information
terminalname [in] name string
戻り値:
the category id.

dfa_lookup.c44 行で定義されています。

参照元 make_dfa_voca_ref().

void extract_cpair ( DFA_INFO dinfo  ) 

Extract category-pair constraint from DFA grammar and newly set the category pair matrix of the give DFA.

引数:
dinfo [i/o] DFA grammar, in which the category-pair matrix will be created.

mkcpair.c60 行で定義されています。

参照元 multigram_exec().

void cpair_append ( DFA_INFO dst,
DFA_INFO src,
int  coffset 
)

Append the category pair matrix at the last.

引数:
dst [i/o] DFA grammar
src [in] DFA grammar to be appended to dst
coffset [in] category id in dst where the new data should be stored

mkcpair.c113 行で定義されています。

参照元 multigram_build_append().

void print_dfa_info ( DFA_INFO dinfo  ) 

Output overall grammar information to stdout.

引数:
dinfo [in] DFA grammar

dfa_util.c33 行で定義されています。

参照元 print_info().

void print_dfa_cp ( DFA_INFO dinfo  ) 

Output the category-pair matrix in text format to stdout

引数:
dinfo [in] DFA grammar that holds category pair matrix

dfa_util.c48 行で定義されています。

参照元 print_info().

boolean dfa_cp ( DFA_INFO dfa,
int  i,
int  j 
)

Return whether the given two category can be connected or not.

引数:
dfa [in] DFA grammar holding category pair matrix
i [in] category id of left word
j [in] category id of right word
戻り値:
TRUE if connection is allowed by the grammar, FALSE if prohibited.

cpair.c48 行で定義されています。

参照元 cpair_append(), get_back_trellis_proceed(), と print_dfa_cp().

boolean dfa_cp_begin ( DFA_INFO dfa,
int  i 
)

Return whether the category can be appear at the beginning of sentence.

引数:
dfa [in] DFA grammar holding category pair matrix
i [in] category id of the word
戻り値:
TRUE if it can appear at the beginning of sentence, FALSE if not.

cpair.c63 行で定義されています。

参照元 cpair_append(), init_nodescore(), と print_dfa_cp().

boolean dfa_cp_end ( DFA_INFO dfa,
int  i 
)

Return whether the category can be appear at the end of sentence.

引数:
dfa [in] DFA grammar holding category pair matrix
i [in] category id of the word
戻り値:
TRUE if it can appear at the end of sentence, FALSE if not.

cpair.c78 行で定義されています。

参照元 cpair_append(), と print_dfa_cp().

void set_dfa_cp ( DFA_INFO dfa,
int  i,
int  j,
boolean  value 
)

Set the category-pair matrix bit

引数:
dfa [out] DFA grammar holding category pair matrix
i [in] category id of left word
j [in] category id of right word
value TRUE if connection allowed, FALSE if connection prohibited.

cpair.c93 行で定義されています。

参照元 cpair_append(), extract_cpair(), malloc_dfa_cp(), と realloc_dfa_cp().

void set_dfa_cp_begin ( DFA_INFO dfa,
int  i,
boolean  value 
)

Set the category-pair matrix bit at the beginning of sentence

引数:
dfa [out] DFA grammar holding category pair matrix
i [in] category id of the word
value TRUE if the category can appear at the beginning of sentence, FALSE if not.

cpair.c112 行で定義されています。

参照元 cpair_append(), extract_cpair(), malloc_dfa_cp(), と realloc_dfa_cp().

void set_dfa_cp_end ( DFA_INFO dfa,
int  i,
boolean  value 
)

Set the category-pair matrix bit at the end of sentence

引数:
dfa [out] DFA grammar holding category pair matrix
i [in] category id of the word
value TRUE if the category can appear at the end of sentence, FALSE if not.

cpair.c131 行で定義されています。

参照元 cpair_append(), extract_cpair(), malloc_dfa_cp(), と realloc_dfa_cp().

void init_dfa_cp ( DFA_INFO dfa  ) 

Initialize category pair matrix in the grammar data.

引数:
dfa [out] DFA grammar to hold category pair matrix

cpair.c147 行で定義されています。

参照元 dfa_info_new().

void malloc_dfa_cp ( DFA_INFO dfa,
int  term_num 
)

Allocate memory for category pair matrix and initialize it.

引数:
dfa [out] DFA grammar to hold category pair matrix
term_num [in] number of categories in the grammar

cpair.c162 行で定義されています。

参照元 extract_cpair(), と realloc_dfa_cp().

void realloc_dfa_cp ( DFA_INFO dfa,
int  old_term_num,
int  new_term_num 
)

Re-allocate memory for category pair matrix, can be called when the number of category is expanded.

引数:
dfa [I/O] DFA grammar holding category pair matrix
old_term_num [in] number of categories when the last category pair matrix was allocated
new_term_num [in] new number of categories in the grammar

cpair.c193 行で定義されています。

参照元 cpair_append().

void free_dfa_cp ( DFA_INFO dfa  ) 

Free the category pair matrix from DFA grammar.

引数:
dfa [i/o] DFA grammar holding category pair matrix

cpair.c254 行で定義されています。

参照元 dfa_info_free().

void 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.

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

init_dfa.c71 行で定義されています。

参照元 multigram_exec().

void make_terminfo ( TERM_INFO tinfo,
DFA_INFO dinfo,
WORD_INFO winfo 
)

Make a word list for each category.

引数:
tinfo [i/o] terminal data structure to hold the result
dinfo [in] DFA gammar to supply the number of category in the grammar
winfo [in] word dictionary.

mkterminfo.c38 行で定義されています。

参照元 make_dfa_voca_ref().

void terminfo_append ( TERM_INFO dst,
TERM_INFO src,
int  coffset,
int  woffset 
)

Append the terminal(category) word list.

引数:
dst [i/o] category data
src [i/o] category data to be appended to dst
coffset [in] category id offset in dst where the new data should be stored
woffset [in] word id offset where the new data should be stored

mkterminfo.c76 行で定義されています。

参照元 multigram_build_append().

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.

引数:
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

init_dfa.c104 行で定義されています。

参照元 multigram_exec().

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

Append the pause word/category information at the last.

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

init_dfa.c135 行で定義されています。

参照元 multigram_build_append().


Juliusに対してTue Sep 22 00:14:35 2009に生成されました。  doxygen 1.6.0