-
Notifications
You must be signed in to change notification settings - Fork 8
/
pspell.php
310 lines (288 loc) · 11.2 KB
/
pspell.php
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<?php
// Start of pspell v.7.0.4-7ubuntu2
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Load a new dictionary
* @link http://php.net/manual/en/function.pspell-new.php
* @param string $language <p>
* The language parameter is the language code which consists of the
* two letter ISO 639 language code and an optional two letter ISO
* 3166 country code after a dash or underscore.
* </p>
* @param string $spelling [optional] <p>
* The spelling parameter is the requested spelling for languages
* with more than one spelling such as English. Known values are
* 'american', 'british', and 'canadian'.
* </p>
* @param string $jargon [optional] <p>
* The jargon parameter contains extra information to distinguish
* two different words lists that have the same language and
* spelling parameters.
* </p>
* @param string $encoding [optional] <p>
* The encoding parameter is the encoding that words are expected to
* be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
* 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
* 32'. This parameter is largely untested, so be careful when
* using.
* </p>
* @param int $mode [optional] <p>
* The mode parameter is the mode in which spellchecker will work.
* There are several modes available:
* <b>PSPELL_FAST</b> - Fast mode (least number of
* suggestions)
* @return int the dictionary link identifier on success or <b>FALSE</b> on failure.
*/
function pspell_new(string $language, string $spelling = null, string $jargon = null, string $encoding = null, int $mode = 0): int {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Load a new dictionary with personal wordlist
* @link http://php.net/manual/en/function.pspell-new-personal.php
* @param string $personal <p>
* The file where words added to the personal list will be stored.
* It should be an absolute filename beginning with '/' because otherwise
* it will be relative to $HOME, which is "/root" for most systems, and
* is probably not what you want.
* </p>
* @param string $language <p>
* The language code which consists of the two letter ISO 639 language
* code and an optional two letter ISO 3166 country code after a dash
* or underscore.
* </p>
* @param string $spelling [optional] <p>
* The requested spelling for languages with more than one spelling such
* as English. Known values are 'american', 'british', and 'canadian'.
* </p>
* @param string $jargon [optional] <p>
* Extra information to distinguish two different words lists that have
* the same language and spelling parameters.
* </p>
* @param string $encoding [optional] <p>
* The encoding that words are expected to be in. Valid values are
* utf-8, iso8859-*,
* koi8-r, viscii,
* cp1252, machine unsigned 16,
* machine unsigned 32.
* </p>
* @param int $mode [optional] <p>
* The mode in which spellchecker will work. There are several modes available:
* <b>PSPELL_FAST</b> - Fast mode (least number of
* suggestions)
* @return int the dictionary link identifier for use in other pspell functions.
*/
function pspell_new_personal(string $personal, string $language, string $spelling = null, string $jargon = null, string $encoding = null, int $mode = 0): int {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Load a new dictionary with settings based on a given config
* @link http://php.net/manual/en/function.pspell-new-config.php
* @param int $config <p>
* The <i>config</i> parameter is the one returned by
* <b>pspell_config_create</b> when the config was created.
* </p>
* @return int a dictionary link identifier on success.
*/
function pspell_new_config(int $config): int {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Check a word
* @link http://php.net/manual/en/function.pspell-check.php
* @param int $dictionary_link
* @param string $word <p>
* The tested word.
* </p>
* @return bool <b>TRUE</b> if the spelling is correct, <b>FALSE</b> if not.
*/
function pspell_check(int $dictionary_link, string $word): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Suggest spellings of a word
* @link http://php.net/manual/en/function.pspell-suggest.php
* @param int $dictionary_link
* @param string $word <p>
* The tested word.
* </p>
* @return array an array of possible spellings.
*/
function pspell_suggest(int $dictionary_link, string $word): array {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Store a replacement pair for a word
* @link http://php.net/manual/en/function.pspell-store-replacement.php
* @param int $dictionary_link <p>
* A dictionary link identifier, opened with
* <b>pspell_new_personal</b>
* </p>
* @param string $misspelled <p>
* The misspelled word.
* </p>
* @param string $correct <p>
* The fixed spelling for the <i>misspelled</i> word.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_store_replacement(int $dictionary_link, string $misspelled, string $correct): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Add the word to a personal wordlist
* @link http://php.net/manual/en/function.pspell-add-to-personal.php
* @param int $dictionary_link
* @param string $word <p>
* The added word.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_add_to_personal(int $dictionary_link, string $word): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Add the word to the wordlist in the current session
* @link http://php.net/manual/en/function.pspell-add-to-session.php
* @param int $dictionary_link
* @param string $word <p>
* The added word.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_add_to_session(int $dictionary_link, string $word): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Clear the current session
* @link http://php.net/manual/en/function.pspell-clear-session.php
* @param int $dictionary_link
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_clear_session(int $dictionary_link): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Save the personal wordlist to a file
* @link http://php.net/manual/en/function.pspell-save-wordlist.php
* @param int $dictionary_link <p>
* A dictionary link identifier opened with
* <b>pspell_new_personal</b>.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_save_wordlist(int $dictionary_link): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Create a config used to open a dictionary
* @link http://php.net/manual/en/function.pspell-config-create.php
* @param string $language <p>
* The language parameter is the language code which consists of the
* two letter ISO 639 language code and an optional two letter ISO
* 3166 country code after a dash or underscore.
* </p>
* @param string $spelling [optional] <p>
* The spelling parameter is the requested spelling for languages
* with more than one spelling such as English. Known values are
* 'american', 'british', and 'canadian'.
* </p>
* @param string $jargon [optional] <p>
* The jargon parameter contains extra information to distinguish
* two different words lists that have the same language and
* spelling parameters.
* </p>
* @param string $encoding [optional] <p>
* The encoding parameter is the encoding that words are expected to
* be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
* 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
* 32'. This parameter is largely untested, so be careful when
* using.
* </p>
* @return int Retuns a pspell config identifier, or <b>FALSE</b> on error.
*/
function pspell_config_create(string $language, string $spelling = null, string $jargon = null, string $encoding = null): int {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Consider run-together words as valid compounds
* @link http://php.net/manual/en/function.pspell-config-runtogether.php
* @param int $dictionary_link
* @param bool $flag <p>
* <b>TRUE</b> if run-together words should be treated as legal compounds,
* <b>FALSE</b> otherwise.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_runtogether(int $dictionary_link, bool $flag): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Change the mode number of suggestions returned
* @link http://php.net/manual/en/function.pspell-config-mode.php
* @param int $dictionary_link
* @param int $mode <p>
* The mode parameter is the mode in which spellchecker will work.
* There are several modes available:
* <b>PSPELL_FAST</b> - Fast mode (least number of
* suggestions)
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_mode(int $dictionary_link, int $mode): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Ignore words less than N characters long
* @link http://php.net/manual/en/function.pspell-config-ignore.php
* @param int $dictionary_link
* @param int $n <p>
* Words less than <i>n</i> characters will be skipped.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_ignore(int $dictionary_link, int $n): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Set a file that contains personal wordlist
* @link http://php.net/manual/en/function.pspell-config-personal.php
* @param int $dictionary_link
* @param string $file <p>
* The personal wordlist. If the file does not exist, it will be created.
* The file should be writable by whoever PHP runs as (e.g. nobody).
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_personal(int $dictionary_link, string $file): bool {}
/**
* (PHP 5, PHP 7)<br/>
* Location of the main word list
* @link http://php.net/manual/en/function.pspell-config-dict-dir.php
* @param int $conf
* @param string $directory
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_dict_dir(int $conf, string $directory): bool {}
/**
* (PHP 5, PHP 7)<br/>
* location of language data files
* @link http://php.net/manual/en/function.pspell-config-data-dir.php
* @param int $conf
* @param string $directory
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_data_dir(int $conf, string $directory): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Set a file that contains replacement pairs
* @link http://php.net/manual/en/function.pspell-config-repl.php
* @param int $dictionary_link
* @param string $file <p>
* The file should be writable by whoever PHP runs as (e.g. nobody).
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_repl(int $dictionary_link, string $file): bool {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Determine whether to save a replacement pairs list
along with the wordlist
* @link http://php.net/manual/en/function.pspell-config-save-repl.php
* @param int $dictionary_link
* @param bool $flag <p>
* <b>TRUE</b> if replacement pairs should be saved, <b>FALSE</b> otherwise.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pspell_config_save_repl(int $dictionary_link, bool $flag): bool {}
define ('PSPELL_FAST', 1);
define ('PSPELL_NORMAL', 2);
define ('PSPELL_BAD_SPELLERS', 3);
define ('PSPELL_RUN_TOGETHER', 8);
// End of pspell v.7.0.4-7ubuntu2
?>