[phrases] trie_new_from_hash compresses a {str: uint32_t} hashtable into a trie in sorted order

This commit is contained in:
Al
2015-10-04 18:28:17 -04:00
parent 55a5a79b4b
commit ff8986a287
2 changed files with 47 additions and 1 deletions

View File

@@ -80,6 +80,7 @@ typedef struct trie {
trie_t *trie_new_alphabet(uint8_t *alphabet, uint32_t alphabet_size);
trie_t *trie_new(void);
trie_t *trie_new_from_hash(khash_t(str_uint32) *hash);
uint32_t trie_get_char_index(trie_t *self, unsigned char c);
uint32_t trie_get_transition_index(trie_t *self, trie_node_t node, unsigned char c);