diff options
Diffstat (limited to 'src/domain/search.h')
| -rw-r--r-- | src/domain/search.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/domain/search.h b/src/domain/search.h new file mode 100644 index 0000000..3408998 --- /dev/null +++ b/src/domain/search.h @@ -0,0 +1,22 @@ +#ifndef TINY_CONVMEM_DOMAIN_SEARCH_H +#define TINY_CONVMEM_DOMAIN_SEARCH_H + +#include <stdbool.h> +#include <stddef.h> + +#include "domain/message.h" + +typedef struct tiny_search_index tiny_search_index_t; + +tiny_search_index_t *tiny_search_index_create(void); +void tiny_search_index_free(tiny_search_index_t *index); +bool tiny_search_index_add(tiny_search_index_t *index, + const tiny_message_t *message, + size_t message_index); +bool tiny_search_index_candidates(const tiny_search_index_t *index, + const char *query, + size_t **message_indices, + size_t *count); +double tiny_search_score(const char *query, const tiny_message_t *message); + +#endif |
