~ubuntu-branches/ubuntu/vivid/robojournal/vivid-proposed

« back to all changes in this revision

Viewing changes to core/hunspell/hunspell.h

  • Committer: Package Import Robot
  • Author(s): Ritesh Raj Sarraf
  • Date: 2014-10-14 15:50:21 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20141014155021-gjd34w00cquge8jf
Tags: 0.5-1
* [d7ce610] Imported Upstream version 0.5
* [ff3b609] Refine what is in the docs/
* [c1e0474] Add doc-base registration
* [68cd341] Install upstream provided xpm icon
* [a627af4] Add patch to override hardcoded doc location

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This file is part of RoboJournal.
 
3
    Copyright (c) 2014 by Will Kraft <pwizard@gmail.com>.
 
4
 
 
5
    RoboJournal is free software: you can redistribute it and/or modify
 
6
    it under the terms of the GNU General Public License as published by
 
7
    the Free Software Foundation, either version 3 of the License, or
 
8
    (at your option) any later version.
 
9
 
 
10
    RoboJournal is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
    GNU General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with RoboJournal.  If not, see <http://www.gnu.org/licenses/>.
 
17
  */
 
18
 
 
19
/* ***** BEGIN LICENSE BLOCK *****
 
20
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
21
 *
 
22
 * The contents of this file are subject to the Mozilla Public License Version
 
23
 * 1.1 (the "License"); you may not use this file except in compliance with
 
24
 * the License. You may obtain a copy of the License at
 
25
 * http://www.mozilla.org/MPL/
 
26
 *
 
27
 * Software distributed under the License is distributed on an "AS IS" basis,
 
28
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
29
 * for the specific language governing rights and limitations under the
 
30
 * License.
 
31
 *
 
32
 * The Original Code is Hunspell, based on MySpell.
 
33
 *
 
34
 * The Initial Developers of the Original Code are
 
35
 * Kevin Hendricks (MySpell) and Laszlo Nemeth (Hunspell).
 
36
 * Portions created by the Initial Developers are Copyright (C) 2002-2005
 
37
 * the Initial Developers. All Rights Reserved.
 
38
 *
 
39
 * Contributor(s):
 
40
 * David Einstein
 
41
 * Davide Prina
 
42
 * Giuseppe Modugno
 
43
 * Gianluca Turconi
 
44
 * Simon Brouwer
 
45
 * Noll Janos
 
46
 * Biro Arpad
 
47
 * Goldman Eleonora
 
48
 * Sarlos Tamas
 
49
 * Bencsath Boldizsar
 
50
 * Halacsy Peter
 
51
 * Dvornik Laszlo
 
52
 * Gefferth Andras
 
53
 * Nagy Viktor
 
54
 * Varga Daniel
 
55
 * Chris Halls
 
56
 * Rene Engelhard
 
57
 * Bram Moolenaar
 
58
 * Dafydd Jones
 
59
 * Harri Pitkanen
 
60
 * Andras Timar
 
61
 * Tor Lillqvist
 
62
 *
 
63
 * Alternatively, the contents of this file may be used under the terms of
 
64
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
65
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
66
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
67
 * of those above. If you wish to allow use of your version of this file only
 
68
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
69
 * use your version of this file under the terms of the MPL, indicate your
 
70
 * decision by deleting the provisions above and replace them with the notice
 
71
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
72
 * the provisions above, a recipient may use your version of this file under
 
73
 * the terms of any one of the MPL, the GPL or the LGPL.
 
74
 *
 
75
 * ***** END LICENSE BLOCK ***** */
 
76
 
 
77
#ifndef _MYSPELLMGR_H_
 
78
#define _MYSPELLMGR_H_
 
79
 
 
80
#include "hunvisapi.h"
 
81
 
 
82
#ifdef __cplusplus
 
83
extern "C" {
 
84
#endif
 
85
 
 
86
typedef struct Hunhandle Hunhandle;
 
87
 
 
88
LIBHUNSPELL_DLL_EXPORTED Hunhandle *Hunspell_create(const char * affpath, const char * dpath);
 
89
 
 
90
LIBHUNSPELL_DLL_EXPORTED Hunhandle *Hunspell_create_key(const char * affpath, const char * dpath,
 
91
    const char * key);
 
92
 
 
93
LIBHUNSPELL_DLL_EXPORTED void Hunspell_destroy(Hunhandle *pHunspell);
 
94
 
 
95
/* spell(word) - spellcheck word
 
96
 * output: 0 = bad word, not 0 = good word
 
97
 */
 
98
LIBHUNSPELL_DLL_EXPORTED int Hunspell_spell(Hunhandle *pHunspell, const char *);
 
99
 
 
100
LIBHUNSPELL_DLL_EXPORTED char *Hunspell_get_dic_encoding(Hunhandle *pHunspell);
 
101
 
 
102
/* suggest(suggestions, word) - search suggestions
 
103
 * input: pointer to an array of strings pointer and the (bad) word
 
104
 *   array of strings pointer (here *slst) may not be initialized
 
105
 * output: number of suggestions in string array, and suggestions in
 
106
 *   a newly allocated array of strings (*slts will be NULL when number
 
107
 *   of suggestion equals 0.)
 
108
 */
 
109
LIBHUNSPELL_DLL_EXPORTED int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word);
 
110
 
 
111
 /* morphological functions */
 
112
 
 
113
 /* analyze(result, word) - morphological analysis of the word */
 
114
 
 
115
LIBHUNSPELL_DLL_EXPORTED int Hunspell_analyze(Hunhandle *pHunspell, char*** slst, const char * word);
 
116
 
 
117
 /* stem(result, word) - stemmer function */
 
118
 
 
119
LIBHUNSPELL_DLL_EXPORTED int Hunspell_stem(Hunhandle *pHunspell, char*** slst, const char * word);
 
120
 
 
121
 /* stem(result, analysis, n) - get stems from a morph. analysis
 
122
  * example:
 
123
  * char ** result, result2;
 
124
  * int n1 = Hunspell_analyze(result, "words");
 
125
  * int n2 = Hunspell_stem2(result2, result, n1);   
 
126
  */
 
127
 
 
128
LIBHUNSPELL_DLL_EXPORTED int Hunspell_stem2(Hunhandle *pHunspell, char*** slst, char** desc, int n);
 
129
 
 
130
 /* generate(result, word, word2) - morphological generation by example(s) */
 
131
 
 
132
LIBHUNSPELL_DLL_EXPORTED int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word,
 
133
    const char * word2);
 
134
 
 
135
 /* generate(result, word, desc, n) - generation by morph. description(s)
 
136
  * example:
 
137
  * char ** result;
 
138
  * char * affix = "is:plural"; // description depends from dictionaries, too
 
139
  * int n = Hunspell_generate2(result, "word", &affix, 1);
 
140
  * for (int i = 0; i < n; i++) printf("%s\n", result[i]);
 
141
  */
 
142
 
 
143
LIBHUNSPELL_DLL_EXPORTED int Hunspell_generate2(Hunhandle *pHunspell, char*** slst, const char * word,
 
144
    char** desc, int n);
 
145
 
 
146
  /* functions for run-time modification of the dictionary */
 
147
 
 
148
  /* add word to the run-time dictionary */
 
149
  
 
150
LIBHUNSPELL_DLL_EXPORTED int Hunspell_add(Hunhandle *pHunspell, const char * word);
 
151
 
 
152
  /* add word to the run-time dictionary with affix flags of
 
153
   * the example (a dictionary word): Hunspell will recognize
 
154
   * affixed forms of the new word, too.
 
155
   */
 
156
  
 
157
LIBHUNSPELL_DLL_EXPORTED int Hunspell_add_with_affix(Hunhandle *pHunspell, const char * word, const char * example);
 
158
 
 
159
  /* remove word from the run-time dictionary */
 
160
 
 
161
LIBHUNSPELL_DLL_EXPORTED int Hunspell_remove(Hunhandle *pHunspell, const char * word);
 
162
 
 
163
  /* free suggestion lists */
 
164
 
 
165
LIBHUNSPELL_DLL_EXPORTED void Hunspell_free_list(Hunhandle *pHunspell, char *** slst, int n);
 
166
 
 
167
#ifdef __cplusplus
 
168
}
 
169
#endif
 
170
 
 
171
#endif