10 typedef struct Hunhandle Hunhandle
;
12 LIBHUNSPELL_DLL_EXPORTED Hunhandle
*Hunspell_create(const char * affpath
, const char * dpath
);
14 LIBHUNSPELL_DLL_EXPORTED Hunhandle
*Hunspell_create_key(const char * affpath
, const char * dpath
,
17 LIBHUNSPELL_DLL_EXPORTED
void Hunspell_destroy(Hunhandle
*pHunspell
);
19 /* spell(word) - spellcheck word
20 * output: 0 = bad word, not 0 = good word
22 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_spell(Hunhandle
*pHunspell
, const char *);
24 LIBHUNSPELL_DLL_EXPORTED
char *Hunspell_get_dic_encoding(Hunhandle
*pHunspell
);
26 /* suggest(suggestions, word) - search suggestions
27 * input: pointer to an array of strings pointer and the (bad) word
28 * array of strings pointer (here *slst) may not be initialized
29 * output: number of suggestions in string array, and suggestions in
30 * a newly allocated array of strings (*slts will be NULL when number
31 * of suggestion equals 0.)
33 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_suggest(Hunhandle
*pHunspell
, char*** slst
, const char * word
);
35 /* morphological functions */
37 /* analyze(result, word) - morphological analysis of the word */
39 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_analyze(Hunhandle
*pHunspell
, char*** slst
, const char * word
);
41 /* stem(result, word) - stemmer function */
43 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_stem(Hunhandle
*pHunspell
, char*** slst
, const char * word
);
45 /* stem(result, analysis, n) - get stems from a morph. analysis
47 * char ** result, result2;
48 * int n1 = Hunspell_analyze(result, "words");
49 * int n2 = Hunspell_stem2(result2, result, n1);
52 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_stem2(Hunhandle
*pHunspell
, char*** slst
, char** desc
, int n
);
54 /* generate(result, word, word2) - morphological generation by example(s) */
56 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_generate(Hunhandle
*pHunspell
, char*** slst
, const char * word
,
59 /* generate(result, word, desc, n) - generation by morph. description(s)
62 * char * affix = "is:plural"; // description depends from dictionaries, too
63 * int n = Hunspell_generate2(result, "word", &affix, 1);
64 * for (int i = 0; i < n; i++) printf("%s\n", result[i]);
67 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_generate2(Hunhandle
*pHunspell
, char*** slst
, const char * word
,
70 /* functions for run-time modification of the dictionary */
72 /* add word to the run-time dictionary */
74 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_add(Hunhandle
*pHunspell
, const char * word
);
76 /* add word to the run-time dictionary with affix flags of
77 * the example (a dictionary word): Hunspell will recognize
78 * affixed forms of the new word, too.
81 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_add_with_affix(Hunhandle
*pHunspell
, const char * word
, const char * example
);
83 /* remove word from the run-time dictionary */
85 LIBHUNSPELL_DLL_EXPORTED
int Hunspell_remove(Hunhandle
*pHunspell
, const char * word
);
87 /* free suggestion lists */
89 LIBHUNSPELL_DLL_EXPORTED
void Hunspell_free_list(Hunhandle
*pHunspell
, char *** slst
, int n
);