forked from varnamproject/libvarnam
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwords-table.h
83 lines (58 loc) · 1.9 KB
/
words-table.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* varnam-words-table.h
*
* Copyright (C) Navaneeth.K.N
*
* This is part of libvarnam. See LICENSE.txt for the license
*/
#ifndef VARNAM_WORDS_TABLE_H_INCLUDED
#define VARNAM_WORDS_TABLE_H_INCLUDED
#include "vtypes.h"
#include "varray.h"
#define MAXIMUM_PATTERNS_TO_LEARN 32
int
vwt_ensure_schema_exists(varnam *handle);
int
vwt_persist_possibilities(varnam *handle, varray *tokens, const char *word, int confidence);
int
vwt_start_changes(varnam *handle);
int
vwt_end_changes(varnam *handle);
int
vwt_discard_changes(varnam *handle);
int
vwt_get_words_count(varnam *handle, bool onlyLearned, int *wordCount);
int
vwt_optimize_for_huge_transaction(varnam *handle);
int
vwt_turn_off_optimization_for_huge_transaction(varnam *handle);
int
vwt_get_best_match (varnam *handle, const char *input, varray *words);
/**
* Gets the suggestions for input and store it in words array
**/
int
vwt_get_suggestions (varnam *handle, const char *input, varray *words);
/**
* Tokenizes the pattern based on words table. Result will be multidimensional
* array where each sub array containing vtoken instances. */
int
vwt_tokenize_pattern (varnam *handle, const char *pattern, varray *result);
int
vwt_compact_file (varnam *handle);
int
vwt_get_word_id (varnam *handle, const char *word, sqlite3_int64 *word_id);
int
vwt_try_insert_new_word (varnam* handle, const char* word, int confidence, sqlite3_int64* new_word_id);
int
vwt_persist_pattern(varnam *handle, const char *pattern, sqlite3_int64 word_id, bool is_prefix);
int
vwt_delete_word(varnam *handle, const char *word);
int
vwt_export_words(varnam* handle, int words_per_file, const char* out_dir,
void (*callback)(int total_words, int processed, const char *current_word));
int
vwt_full_export(varnam* handle, int words_per_file, const char* out_dir,
void (*callback)(int, int, const char *));
int
vwt_import_words (varnam* handle, const char* filepath);
#endif