Julius 4.2
関数
libsent/src/dfa/cpair.c

カテゴリ対制約へのアクセス関数およびメモリ管理 [詳細]

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

ソースコードを見る。

関数

static int cp_find (int *list, int len, int key, int *loc)
 Search for a terminal ID in a cp list.
boolean dfa_cp (DFA_INFO *dfa, int i, int j)
 Return whether the given two category can be connected or not.
boolean dfa_cp_begin (DFA_INFO *dfa, int i)
 Return whether the category can be appear at the beginning of sentence.
boolean dfa_cp_end (DFA_INFO *dfa, int i)
 Return whether the category can be appear at the end of sentence.
static boolean cp_add (int **list, int *len, int *alloclen, int val, int loc)
 Add an terminal ID to a specified location in the cp list.
static boolean cp_remove (int **list, int *len, int loc)
 Remove an element from the cp list.
void set_dfa_cp (DFA_INFO *dfa, int i, int j, boolean value)
 Set a category-pair matrix bit.
void set_dfa_cp_begin (DFA_INFO *dfa, int i, boolean value)
 Set a category-pair matrix bit for the beginning of sentence.
void set_dfa_cp_end (DFA_INFO *dfa, int i, boolean value)
 Set a category-pair matrix bit for the end of sentence.
void init_dfa_cp (DFA_INFO *dfa)
 Initialize category pair matrix in the grammar data.
void malloc_dfa_cp (DFA_INFO *dfa, int term_num, int size)
 Allocate memory for category pair matrix and initialize it.
boolean dfa_cp_append (DFA_INFO *dfa, DFA_INFO *src, int offset)
 Append a categori-pair matrix to another.
void free_dfa_cp (DFA_INFO *dfa)
 Free the category pair matrix from DFA grammar.
void dfa_cp_output_rawdata (FILE *fp, DFA_INFO *dfa)
void dfa_cp_count_size (DFA_INFO *dfa, unsigned long *size_ret, unsigned long *allocsize_ret)

説明

カテゴリ対制約へのアクセス関数およびメモリ管理

カテゴリ対制約のメモリ確保,およびカテゴリ間の接続の可否を返す関数です.

作者:
Akinobu LEE
日付:
Tue Feb 15 13:54:44 2005
Revision:
1.5

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


関数

static int cp_find ( int *  list,
int  len,
int  key,
int *  loc 
) [static]

Search for a terminal ID in a cp list.

Set its location to loc. When not found, the location where to insert the key data iwill be set.

引数:
list[in] cp list
len[in] length of list
key[in] a terminal ID value to find
loc[out] return the to-be-inserted location of the key
戻り値:
its location when found, or -1 when not found.

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

参照元 dfa_cp(), dfa_cp_begin(), dfa_cp_end(), set_dfa_cp(), set_dfa_cp_begin(), と set_dfa_cp_end().

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.c91 行で定義されています。

参照元 beam_inter_word(), と can_succeed().

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.c109 行で定義されています。

参照元 can_succeed(), と init_nodescore().

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.c126 行で定義されています。

static boolean cp_add ( int **  list,
int *  len,
int *  alloclen,
int  val,
int  loc 
) [static]

Add an terminal ID to a specified location in the cp list.

引数:
list[i/o] cp list
len[i/o] data num in the list
alloclen[i/o] allocated length of the list
val[in] value to be added
loc[in] location where to add the val
戻り値:
TRUE on success, FALSE on failure.

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

参照元 set_dfa_cp(), set_dfa_cp_begin(), と set_dfa_cp_end().

static boolean cp_remove ( int **  list,
int *  len,
int  loc 
) [static]

Remove an element from the cp list.

引数:
list[i/o] cp list
len[i/o] data num in the list
loc[in] location of removing value
戻り値:
TRUE on success, FALSE on error.

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

参照元 set_dfa_cp(), set_dfa_cp_begin(), と set_dfa_cp_end().

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

Set a 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
valueTRUE if connection allowed, FALSE if connection prohibited.

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

参照元 extract_cpair().

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

Set a category-pair matrix bit for the beginning of sentence.

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

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

参照元 extract_cpair().

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

Set a category-pair matrix bit for the end of sentence.

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

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

参照元 extract_cpair().

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.c274 行で定義されています。

参照元 dfa_info_new().

void malloc_dfa_cp ( DFA_INFO dfa,
int  term_num,
int  size 
)

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
size[in] memory allocation length for each cp list as initial

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

参照元 extract_cpair().

boolean dfa_cp_append ( DFA_INFO dfa,
DFA_INFO src,
int  offset 
)

Append a categori-pair matrix to another.

This function assumes that other grammar information has been already appended and dfa->term_num contains the new size.

引数:
dfa[i/o] DFA grammar to which the new category pair will be appended
src[in] source DFA
offset[in] appending point at dfa
戻り値:
TRUE on success, FALSE on error.

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

参照元 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.c396 行で定義されています。

参照元 dfa_info_free().