summaryrefslogtreecommitdiff
path: root/src/dfi-text-index.h
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-10-04 21:43:15 -0400
committerRyan Lortie <desrt@desrt.ca>2013-10-04 21:43:15 -0400
commit2bb8dd2bb61bbcfe528ef7ff8dff78f328460369 (patch)
tree7d730f91ec516fb7cc0da6a94ec177219489f35a /src/dfi-text-index.h
parent40b616d64847bba6de03eb6b8e7a3e311c5f58cd (diff)
Convert text index to a hash table
Just like the string list before it, we see a substantial performance improvement from converting DfiTextIndex to be based on GHashTable instead of GSequence.
Diffstat (limited to 'src/dfi-text-index.h')
-rw-r--r--src/dfi-text-index.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/dfi-text-index.h b/src/dfi-text-index.h
index 5e53dd8..1683a3d 100644
--- a/src/dfi-text-index.h
+++ b/src/dfi-text-index.h
@@ -23,8 +23,9 @@
#define __dfi_text_index_h__
#include "dfi-string-table.h"
+#include "dfi-id-list.h"
-typedef GSequence DfiTextIndex;
+typedef struct _DfiTextIndex DfiTextIndex;
DfiTextIndex * dfi_text_index_new (void);
@@ -40,9 +41,13 @@ void dfi_text_index_add_ids_tokenised (DfiText
const guint16 *ids,
gint n_ids);
-void dfi_text_index_get_item (GSequenceIter *iter,
- const gchar **token,
- GArray **id_list);
+void dfi_text_index_convert (DfiTextIndex *text_index);
+
+const gchar * const * dfi_text_index_get_tokens (DfiTextIndex *text_index,
+ guint *n_tokens);
+
+DfiIdList * dfi_text_index_get_id_list_for_token (DfiTextIndex *text_index,
+ const gchar *token);
void dfi_text_index_populate_strings (DfiTextIndex *text_index,
DfiStringTable *string_table);