Julius 4.2
|
データ検索用汎用パトリシア検索木の定義 [詳細]
データ構造 | |
struct | APATNODE |
Patricia binary tree node, to search related pointer from string. [詳細] | |
struct | PATNODE |
Another patricia binary tree node, to search integer value from string. [詳細] | |
関数 | |
int | testbit (char *str, int slen, int bitplace) |
String bit test function. | |
int | testbit_max (char *str, int bitplace, int maxbitplace) |
Local bit test function for search. | |
int | where_the_bit_differ (char *str1, char *str2) |
Find in which bit the two strings differ, starting from the head. | |
PATNODE * | make_ptree (char **words, int *data, int wordsnum, int bitplace, BMALLOC_BASE **mroot) |
Make a patricia tree for given string arrays. | |
void | disp_ptree (PATNODE *node, int level) |
Output a tree structure in text for debug, traversing pre-order. | |
int | ptree_search_data (char *str, PATNODE *rootnode) |
Search for the data whose key string matches the given string. | |
int | ptree_replace_data (char *str, int val, PATNODE *node) |
Search for the data whose key string matches the given string, and replace its value. | |
PATNODE * | ptree_make_root_node (int data, BMALLOC_BASE **mroot) |
Make a root node of a index tree. | |
void | ptree_add_entry (char *str, int data, char *matchstr, PATNODE **rootnode, BMALLOC_BASE **mroot) |
Insert a new node to the index tree. | |
void * | aptree_search_data (char *str, APATNODE *rootnode) |
Search for the data whose key string matches the given string. | |
APATNODE * | aptree_make_root_node (void *data, BMALLOC_BASE **mroot) |
Make a root node of a index tree. | |
void | aptree_add_entry (char *str, void *data, char *matchstr, APATNODE **rootnode, BMALLOC_BASE **mroot) |
Insert a new node to the index tree. | |
void | aptree_remove_entry (char *str, APATNODE **rootnode) |
Remove a node from the index tree. | |
void | aptree_traverse_and_do (APATNODE *node, void(*callback)(void *)) |
Recursive function to traverse index tree and execute the callback for all the existing data. | |
boolean | aptree_write (FILE *fp, APATNODE *root, boolean(*save_data_func)(void *, FILE *fp)) |
boolean | aptree_read (FILE *fp, APATNODE **root, BMALLOC_BASE **mroot, void *data, boolean(*load_data_func)(void **, void *, FILE *fp)) |
データ検索用汎用パトリシア検索木の定義
文字列からその名前を持つ構造体や対応するIDを検索するための パトリシア木の構造体です.
ptree.h で定義されています。
int testbit | ( | char * | str, |
int | slen, | ||
int | bitplace | ||
) |
String bit test function.
str | [in] key string |
bitplace | [in] bit location to test |
参照元 aptree_add_entry_at(), make_ptree(), ptree_add_entry_at(), と where_the_bit_differ().
int testbit_max | ( | char * | str, |
int | bitplace, | ||
int | maxbitplace | ||
) |
Local bit test function for search.
str | [in] key string |
bitplace | [in] bit place to test. |
maxbitplace | [in] maximum number of bitplace |
参照元 aptree_remove_entry_r(), aptree_search_data_r(), ptree_replace_data_r(), と ptree_search_data_r().
int where_the_bit_differ | ( | char * | str1, |
char * | str2 | ||
) |
Find in which bit the two strings differ, starting from the head.
str1 | [in] string 1 |
str2 | [in] string 2 |
参照元 aptree_add_entry(), と ptree_add_entry().
PATNODE* make_ptree | ( | char ** | words, |
int * | data, | ||
int | wordsnum, | ||
int | bitplace, | ||
BMALLOC_BASE ** | mroot | ||
) |
Make a patricia tree for given string arrays.
Recursively called by descending the scan bit.
words | [in] list of word strings |
data | [in] integer value corresponding to each string in words |
wordsnum | [in] number of above |
bitplace | [in] current scan bit. |
mroot | [i/o] base pointer for block malloc |
参照元 make_ptree(), と ngram_make_lookup_tree().
void disp_ptree | ( | PATNODE * | node, |
int | level | ||
) |
Output a tree structure in text for debug, traversing pre-order.
node | [in] root index node |
level | [in] current tree depth |
参照元 disp_ptree().
int ptree_search_data | ( | char * | str, |
PATNODE * | node | ||
) |
Search for the data whose key string matches the given string.
str | [in] search key string |
node | [in] root node of index tree |
参照元 ngram_lookup_word(), と set_unigram().
int ptree_replace_data | ( | char * | str, |
int | val, | ||
PATNODE * | node | ||
) |
Search for the data whose key string matches the given string, and replace its value.
str | [in] search key string |
val | [in] value |
node | [in] root node of index tree |
参照元 ngram_read_arpa().
PATNODE* ptree_make_root_node | ( | int | data, |
BMALLOC_BASE ** | mroot | ||
) |
Make a root node of a index tree.
data | [in] the first data |
mroot | [i/o] base pointer for block malloc |
参照元 ptree_add_entry(), と set_unigram().
void ptree_add_entry | ( | char * | str, |
int | data, | ||
char * | matchstr, | ||
PATNODE ** | rootnode, | ||
BMALLOC_BASE ** | mroot | ||
) |
Insert a new node to the index tree.
str | [in] new key string |
data | [in] new data integer value |
matchstr | [in] the most matching data already exist in the index tree, as obtained by aptree_search_data() |
rootnode | [i/o] pointer to root index node |
mroot | [i/o] base pointer for block malloc |
参照元 set_unigram().
void* aptree_search_data | ( | char * | str, |
APATNODE * | node | ||
) |
Search for the data whose key string matches the given string.
str | [in] search key string |
node | [in] root node of index tree |
参照元 add_to_error(), cdset_lookup(), codebook_add(), codebook_lookup(), dens_add(), dens_lookup(), hmm_add_physical_to_logical(), hmm_add_pseudo_phones_sub(), htk_hmmdata_add(), htk_hmmdata_lookup_logical(), htk_hmmdata_lookup_physical(), make_hmm_basephone_list(), mark_word_edge(), mpdf_add(), mpdf_lookup(), new_str2phseq(), rdhmmlist(), regist_cdset(), state_add(), state_lookup(), sw_add(), sw_lookup(), trans_add(), trans_lookup(), var_add(), と var_lookup().
APATNODE* aptree_make_root_node | ( | void * | data, |
BMALLOC_BASE ** | mroot | ||
) |
Make a root node of a index tree.
data | [in] the first data |
参照元 add_to_error(), aptree_add_entry(), codebook_add(), dens_add(), hmm_add_physical_to_logical(), hmm_add_pseudo_phones_sub(), htk_hmmdata_add(), make_hmm_basephone_list(), mpdf_add(), rdhmmlist(), regist_cdset(), state_add(), sw_add(), trans_add(), と var_add().
void aptree_add_entry | ( | char * | str, |
void * | data, | ||
char * | matchstr, | ||
APATNODE ** | rootnode, | ||
BMALLOC_BASE ** | mroot | ||
) |
Insert a new node to the index tree.
str | [in] new key string |
data | [in] new data pointer |
matchstr | [in] the most matching data already exist in the index tree, as obtained by aptree_search_data() |
rootnode | [i/o] pointer to root index node |
参照元 add_to_error(), codebook_add(), dens_add(), hmm_add_physical_to_logical(), hmm_add_pseudo_phones_sub(), htk_hmmdata_add(), make_hmm_basephone_list(), mpdf_add(), rdhmmlist(), regist_cdset(), state_add(), sw_add(), trans_add(), と var_add().
void aptree_remove_entry | ( | char * | str, |
APATNODE ** | rootnode | ||
) |
void aptree_traverse_and_do | ( | APATNODE * | node, |
void(*)(void *) | callback | ||
) |
Recursive function to traverse index tree and execute the callback for all the existing data.
node | [in] current node |
callback | [in] callback function |
参照元 aptree_traverse_and_do(), count_all_phone(), free_cdset(), list_error(), print_all_basephone_detail(), print_all_basephone_name(), put_all_cdinfo(), test_interword_triphone(), triphone_callback_left(), と wt_tmix().