[phrases] adding token_phrase_memberships to trie_search for reuse

This commit is contained in:
Al
2017-02-08 01:59:39 -05:00
parent ae35da8d17
commit 6e4f641743
2 changed files with 31 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ typedef struct phrase {
VECTOR_INIT(phrase_array, phrase_t)
#define NULL_PHRASE (phrase_t){0, 0, 0}
#define NULL_PHRASE_MEMBERSHIP -1
phrase_array *trie_search(trie_t *self, char *text);
bool trie_search_from_index(trie_t *self, char *text, uint32_t start_node_id, phrase_array **phrases);
@@ -40,6 +41,8 @@ phrase_t trie_search_prefixes_from_index(trie_t *self, char *word, size_t len, u
phrase_t trie_search_prefixes_from_index_get_prefix_char(trie_t *self, char *word, size_t len, uint32_t start_node_id);
phrase_t trie_search_prefixes(trie_t *self, char *word, size_t len);
bool token_phrase_memberships(phrase_array *phrases, int64_array *phrase_memberships, size_t len);
char *cstring_array_get_phrase(cstring_array *str, char_array *phrase_tokens, phrase_t phrase);
#endif