#include <sent/stddefs.h>
#include <sent/ptree.h>
ptree.cのインクルード依存関係図

関数 | |
| int | testbit (char *str, int bitplace) |
| int | where_the_bit_differ (char *str1, char *str2) |
| static PATNODE * | new_node () |
| PATNODE * | make_ptree (char **words, int *data, int wordsnum, int bitplace) |
| void | disp_ptree (PATNODE *node, int level) |
| static int | testbit_local (int bitplace) |
| static int | ptree_search_data_r (PATNODE *node) |
| int | ptree_search_data (char *str, PATNODE *node) |
| PATNODE * | ptree_make_root_node (int data) |
| static void | ptree_add_entry_at (char *str, int bitloc, int data, PATNODE **parentlink) |
| void | ptree_add_entry (char *str, int data, char *matchstr, PATNODE **rootnode) |
| void | free_ptree (PATNODE *node) |
変数 | |
| static char * | tmp_str |
| Local work area: current string we are searching for | |
| static int | maxbitplace |
| Local work area: Maximum bit length of tmp_str | |
ptree.c で定義されています。
| int testbit | ( | char * | str, | |
| 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 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 |
| static PATNODE* new_node | ( | ) | [static] |
| PATNODE* make_ptree | ( | char ** | words, | |
| int * | data, | |||
| int | wordsnum, | |||
| int | bitplace | |||
| ) |
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. |
| void disp_ptree | ( | PATNODE * | node, | |
| int | level | |||
| ) |
| static int testbit_local | ( | int | bitplace | ) | [static] |
| static int ptree_search_data_r | ( | PATNODE * | node | ) | [static] |
Recursive function to search the data in the tree
| node | [in] current node. |
参照元 ptree_search_data().
| 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 |
| PATNODE* ptree_make_root_node | ( | int | data | ) |
Make a root node of a index tree.
| data | [in] the first data |
| static void ptree_add_entry_at | ( | char * | str, | |
| int | bitloc, | |||
| int | data, | |||
| PATNODE ** | parentlink | |||
| ) | [static] |
Insert a new node to the existing index tree.
| str | [in] new key string | |
| bitloc | [in] bit branch to which this node will be added | |
| data | [in] new data integer value | |
| parentlink | [i/o] the parent node to which this node will be added |
参照元 ptree_add_entry().
| void ptree_add_entry | ( | char * | str, | |
| int | data, | |||
| char * | matchstr, | |||
| PATNODE ** | rootnode | |||
| ) |
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 |
参照元 set_unigram().
| void free_ptree | ( | PATNODE * | node | ) |
Free all the sub nodes from specified node.
| node | [in] current node. |
1.5.0