[phrases] trie_num_keys

This commit is contained in:
Al
2016-01-05 22:02:15 -05:00
parent 22668945cb
commit 8c019998d7
2 changed files with 8 additions and 0 deletions

View File

@@ -892,6 +892,12 @@ uint32_t trie_get(trie_t *self, char *word) {
return trie_get_from_index(self, word, word_len, ROOT_NODE_ID);
}
inline uint32_t trie_num_keys(trie_t *self) {
if (self == NULL) return 0;
return self->num_keys;
}
/*
Destructor
*/

View File

@@ -124,6 +124,8 @@ 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_num_keys(trie_t *self);
typedef struct trie_prefix_result {
uint32_t node_id;
size_t tail_pos;