112
112
const struct AspellError * aspell_config_error(const struct AspellConfig * ths);
114
/* sets extra keys which this config class should accept
115
* begin and end are expected to point to the begging
116
* and end of an array of Aspell Key Info */
114
/* Sets extra keys which this config class should
115
* accept. begin and end are expected to point to
116
* the beginning and ending of an array of Aspell
117
118
void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end);
119
/* returns the KeyInfo object for the
120
* corresponding key or returns null and sets
120
/* Returns the KeyInfo object for the
121
* corresponding key or returns NULL and sets
121
122
* error_num to PERROR_UNKNOWN_KEY if the key is
122
123
* not valid. The pointer returned is valid for
123
124
* the lifetime of the object. */
124
125
const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key);
126
/* returns a newly allocated enumeration of all the
127
* possible objects this config class uses */
127
/* Returns a newly allocated enumeration of all
128
* the possible objects this config class uses. */
128
129
struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra);
130
/* returns the default value for given key which
131
* way involve substating variables, thus it is
132
* not the same as keyinfo(key)->def returns null
131
/* Returns the default value for given key which
132
* may involve substituting variables, thus it is
133
* not the same as keyinfo(key)->def returns NULL
133
134
* and sets error_num to PERROR_UNKNOWN_KEY if
134
135
* the key is not valid. Uses the temporary
136
137
const char * aspell_config_get_default(struct AspellConfig * ths, const char * key);
138
/* returns a newly alloacted enumeration of all the
139
* key/value pairs. This DOES not include ones
140
* which are set to their default values */
139
/* Returns a newly allocated enumeration of all
140
* the key/value pairs. This DOES not include ones
141
* which are set to their default values. */
141
142
struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths);
143
/* inserts an item, if the item already exists it
144
* will be replaced. returns true if it succesed
145
* or false on error. If the key in not valid it
144
/* Inserts an item, if the item already exists it
145
* will be replaced. Returns TRUE if it succeeded
146
* or FALSE on error. If the key in not valid it
146
147
* sets error_num to PERROR_UNKNOWN_KEY, if the
147
* value is not valid it will sets error_num to
148
* value is not valid it will set error_num to
148
149
* PERROR_BAD_VALUE, if the value can not be
149
150
* changed it sets error_num to
150
151
* PERROR_CANT_CHANGE_VALUE, and if the value is
151
* a list and you are trying to set it directory
152
* a list and you are trying to set its directory,
152
153
* it sets error_num to PERROR_LIST_SET */
153
154
int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value);
155
/* remove a key and returns true if it exists
156
* otherise return false. This effictly sets the
157
* key to its default value. Calling replace with
158
* a value of "<default>" will also call
159
* remove. If the key does not exists sets
160
* error_num to 0 or PERROR_NOT, if the key in
161
* not valid sets error_num to
156
/* Remove a key and returns TRUE if it exists
157
* otherwise return FALSE. This effectively sets
158
* the key to its default value. Calling replace
159
* with a value of "<default>" will also call
160
* remove. If the key does not exist then it sets
161
* error_num to 0 or PERROR_NOT, if the key is
162
* not valid then it sets error_num to
162
163
* PERROR_UNKNOWN_KEY, if the value can not be
163
* changed sets error_num to
164
* changed then it sets error_num to
164
165
* PERROR_CANT_CHANGE_VALUE */
165
166
int aspell_config_remove(struct AspellConfig * ths, const char * key);
167
168
int aspell_config_have(const struct AspellConfig * ths, const char * key);
169
/* returns null on error */
170
/* Returns NULL on error. */
170
171
const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key);
172
173
int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst);
174
/* return -1 on error, 0 if false, 1 if true */
175
/* Return -1 on error, 0 if false, 1 if true. */
175
176
int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key);
177
/* return -1 on error */
178
/* Return -1 on error. */
178
179
int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key);
339
340
struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths);
341
/* returns 0 if it is not in the dictionary,
342
/* Returns 0 if it is not in the dictionary,
342
343
* 1 if it is, or -1 on error. */
343
344
int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size);
346
/* Add this word to your own personal word list. */
345
347
int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size);
349
/* Add this word to the current spelling session. */
347
350
int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size);
352
/* This is your own personal word list file plus
353
* any extra words added during this session to
354
* your own personal word list. */
349
355
const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths);
357
/* This is a list of words added to this session
358
* that are not in the main word list or in your
359
* own personal list but are considered valid for
360
* this spelling session. */
351
361
const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths);
363
/* This is the main list of words used during this
364
* spelling session. */
353
365
const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths);
355
367
int aspell_speller_save_all_word_lists(struct AspellSpeller * ths);
357
369
int aspell_speller_clear_session(struct AspellSpeller * ths);
359
/* Return null on error.
360
* the word list returned by suggest is only valid until the next
371
/* Return NULL on error.
372
* The word list returned by suggest is only
373
* valid until the next call to suggest. */
362
374
const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size);
364
376
int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size);
423
435
struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj);
425
/* reset the internal state of the filter.
426
* should be called whenever a new document is being filtered */
437
/* Reset the internal state of the filter.
438
* Should be called whenever a new document is
427
440
void aspell_document_checker_reset(struct AspellDocumentChecker * ths);
430
* The string passed in should only be split on white space
431
* characters. Furthermore, between calles to reset, each string
432
* should be passed in exactly once and in the order they appeared
433
* in the document. Passing in stings out of order, skipping
434
* strings or passing them in more than once may lead to undefined
443
* The string passed in should only be split on
444
* white space characters. Furthermore, between
445
* calls to reset, each string should be passed
446
* in exactly once and in the order they appeared
447
* in the document. Passing in strings out of
448
* order, skipping strings or passing them in
449
* more than once may lead to undefined results. */
436
450
void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size);
438
/* returns the next misspelled word in the processed string
439
* if there are no more misspelled word than token.word
440
* will be null and token.size will be 0 */
452
/* Returns the next misspelled word in the
453
* processed string. If there are no more
454
* misspelled words, then token.word will be
455
* NULL and token.size will be 0 */
441
456
struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths);
443
/* returns the underlying filter class */
458
/* Returns the underlying filter class. */
444
459
struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths);
501
516
struct AspellDictInfo {
503
/* name to identify the dictionary by */
518
/* The Name to identify this dictionary by. */
504
519
const char * name;
521
/* The language code to identify this dictionary.
522
* A two letter UPPER-CASE ISO 639 language code
523
* and an optional two letter ISO 3166 country
524
* code after a dash or underscore. */
506
525
const char * code;
527
/* Any extra information to distinguish this
528
* variety of dictionary from other dictionaries
529
* which may have the same language and size. */
508
530
const char * jargon;
534
/* A two char digit code describing the size of
535
* the dictionary: 10=tiny, 20=really small,
536
* 30=small, 40=med-small, 50=med, 60=med-large,
537
* 70=large, 80=huge, 90=insane. Please check
538
* the README in aspell-lang-200?????.tar.bz2 or
539
* see SCOWL (http://wordlist.sourceforge.net)
540
* for an example of how these sizes are used. */
512
541
const char * size_str;
514
543
struct AspellModuleInfo * module;
634
663
struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths);
636
665
/* Insert a new element.
637
* Will NOT overright an existing entry.
638
* Returns false if the element already exists. */
666
* Will NOT overwrite an existing entry.
667
* Returns FALSE if the element already exists. */
639
668
int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value);
641
670
/* Insert a new element.
642
* Will overright an existing entry.
643
* Always returns true. */
671
* Will overwrite an existing entry.
672
* Always returns TRUE. */
644
673
int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value);
646
/* Looks up an element.
647
* Returns null if the element did not exist.
648
* Returns an empty string if the element exists but has a null value.
649
* Otherwises returns the value */
675
/* Looks up an element and returns the value.
676
* Returns NULL if the element does not exist.
677
* Returns an empty string if the element exists
678
* but has a NULL value. */
650
679
const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key);