[phrases] trie_get_prefix_* methods return a struct including tail position
This commit is contained in:
11
src/trie.h
11
src/trie.h
@@ -105,9 +105,14 @@ uint32_t trie_get_from_index(trie_t *self, char *word, size_t len, uint32_t i);
|
||||
uint32_t trie_get_len(trie_t *self, char *word, size_t len);
|
||||
uint32_t trie_get(trie_t *self, char *word);
|
||||
|
||||
uint32_t trie_get_prefix(trie_t *self, char *key, size_t *tail_pos);
|
||||
uint32_t trie_get_prefix_len(trie_t *self, char *key, size_t len, size_t *tail_pos);
|
||||
uint32_t trie_get_prefix_from_index(trie_t *self, char *key, size_t len, uint32_t i, size_t *tail_pos);
|
||||
typedef struct trie_prefix_result {
|
||||
uint32_t node_id;
|
||||
size_t tail_pos;
|
||||
} trie_prefix_result_t;
|
||||
|
||||
trie_prefix_result_t trie_get_prefix(trie_t *self, char *key);
|
||||
trie_prefix_result_t trie_get_prefix_len(trie_t *self, char *key, size_t len);
|
||||
trie_prefix_result_t trie_get_prefix_from_index(trie_t *self, char *key, size_t len, uint32_t i);
|
||||
|
||||
void trie_print(trie_t *self);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user