Module: FFI::Aspell
- Extended by:
- Library
- Defined in:
- lib/ffi/aspell/aspell.rb,
lib/ffi/aspell/error.rb,
lib/ffi/aspell/speller.rb,
lib/ffi/aspell/version.rb
Overview
Defined Under Namespace
Classes: ConfigError, DictInfo, Speller
Constant Summary collapse
- VERSION =
'1.1.0'
Class Method Summary collapse
-
.config_delete(config) ⇒ Object
Removes a config pointer and frees the memory associated with said pointer.
-
.config_new ⇒ FFI::Pointer
Creates a pointer for a configuration struct.
-
.config_remove(config, key) ⇒ TrueClass|FalseClass
Sets the value of the specified configuration item back to its default value.
-
.config_replace(config, key, value) ⇒ TrueClass|FalseClass
Sets the new value of the specified configuration item.
-
.config_retrieve(config, key) ⇒ String
Retrieves the value of a given configuration item.
-
.config_retrieve_default(config, key) ⇒ Object
Retrieves the default value of a configuration item.
-
.delete_dict_info_enumeration(enumeration) ⇒ Object
Deletes an enumeration of dictionaries.
-
.dict_info_enumeration_next(elements) ⇒ DictInfo|NilClass
Retrieves the next element in the list of dictionaries.
-
.dict_info_list(config) ⇒ FFI::Pointer
Gets a list of all installed aspell dictionaries.
-
.dict_info_list_elements(list) ⇒ FFI::Pointer
Gets all elements from the dictionary list.
-
.speller_check(speller, word, length) ⇒ TrueClass|FalseClass
Checks if a given word is spelled correctly or not.
-
.speller_delete(speller) ⇒ Object
Removes a speller pointer and frees the memory associated with said pointer.
-
.speller_new(config) ⇒ FFI::Pointer
Creates a pointer to a speller struct.
-
.string_enumeration_delete(elements) ⇒ Object
Removes the pointer returned by Aspell.word_list_elements and frees the associated memory.
-
.string_enumeration_next(elements) ⇒ String|NilClass
Retrieves the next item in the list of suggestions.
-
.word_list_elements(suggestions) ⇒ FFI::Pointer
Returns a pointer to a list which can be used by Aspell.string_enumeration_next to retrieve all the suggested words.
Instance Method Summary collapse
-
#speller_suggest(speller, word, length) ⇒ FFI::Pointer
Returns a pointer that can be used to retrieve a list of suggestions for a given word.
Class Method Details
.config_delete(config) ⇒ Object
Removes a config pointer and frees the memory associated with said pointer.
46 47 48 49 |
# File 'lib/ffi/aspell/aspell.rb', line 46 attach_function 'config_delete', 'delete_aspell_config', [:pointer], :void |
.config_new ⇒ FFI::Pointer
Creates a pointer for a configuration struct.
33 34 35 36 |
# File 'lib/ffi/aspell/aspell.rb', line 33 attach_function 'config_new', 'new_aspell_config', [], :pointer |
.config_remove(config, key) ⇒ TrueClass|FalseClass
Sets the value of the specified configuration item back to its default value.
120 121 122 123 |
# File 'lib/ffi/aspell/aspell.rb', line 120 attach_function 'config_remove', 'aspell_config_remove', [:pointer, :string], :bool |
.config_replace(config, key, value) ⇒ TrueClass|FalseClass
Sets the new value of the specified configuration item.
99 100 101 102 |
# File 'lib/ffi/aspell/aspell.rb', line 99 attach_function 'config_replace', 'aspell_config_replace', [:pointer, :string, :string], :bool |
.config_retrieve(config, key) ⇒ String
Retrieves the value of a given configuration item. The value is returned as a string or nil upon failure.
67 68 69 70 |
# File 'lib/ffi/aspell/aspell.rb', line 67 attach_function 'config_retrieve', 'aspell_config_retrieve', [:pointer, :string], :string |
.config_retrieve_default(config, key) ⇒ Object
Retrieves the default value of a configuration item.
79 80 81 82 |
# File 'lib/ffi/aspell/aspell.rb', line 79 attach_function 'config_retrieve_default', 'aspell_config_get_default', [:pointer, :string], :string |
.delete_dict_info_enumeration(enumeration) ⇒ Object
Deletes an enumeration of dictionaries.
295 296 297 298 |
# File 'lib/ffi/aspell/aspell.rb', line 295 attach_function 'delete_dict_info_enumeration', 'delete_aspell_dict_info_enumeration', [:pointer], :void |
.dict_info_enumeration_next(elements) ⇒ DictInfo|NilClass
Retrieves the next element in the list of dictionaries.
310 311 312 313 |
# File 'lib/ffi/aspell/aspell.rb', line 310 attach_function 'dict_info_enumeration_next', 'aspell_dict_info_enumeration_next', [:pointer], DictInfo |
.dict_info_list(config) ⇒ FFI::Pointer
Gets a list of all installed aspell dictionaries.
267 268 269 270 |
# File 'lib/ffi/aspell/aspell.rb', line 267 attach_function 'dict_info_list', 'get_aspell_dict_info_list', [:pointer], :pointer |
.dict_info_list_elements(list) ⇒ FFI::Pointer
Gets all elements from the dictionary list.
282 283 284 285 |
# File 'lib/ffi/aspell/aspell.rb', line 282 attach_function 'dict_info_list_elements', 'aspell_dict_info_list_elements', [:pointer], :pointer |
.speller_check(speller, word, length) ⇒ TrueClass|FalseClass
Checks if a given word is spelled correctly or not. If the word is valid
true
will be returned, false
otherwise.
181 182 183 184 |
# File 'lib/ffi/aspell/aspell.rb', line 181 attach_function 'speller_check', 'aspell_speller_check', [:pointer, :string, :int], :bool |
.speller_delete(speller) ⇒ Object
Removes a speller pointer and frees the memory associated with said pointer.
153 154 155 156 |
# File 'lib/ffi/aspell/aspell.rb', line 153 attach_function 'speller_delete', 'delete_aspell_speller', [:pointer], :void |
.speller_new(config) ⇒ FFI::Pointer
Creates a pointer to a speller struct.
140 141 142 143 |
# File 'lib/ffi/aspell/aspell.rb', line 140 attach_function 'speller_new', 'new_aspell_speller', [:pointer], :pointer |
.string_enumeration_delete(elements) ⇒ Object
Removes the pointer returned by word_list_elements and frees the associated memory.
225 226 227 228 |
# File 'lib/ffi/aspell/aspell.rb', line 225 attach_function 'string_enumeration_delete', 'delete_aspell_string_enumeration', [:pointer], :void |
.string_enumeration_next(elements) ⇒ String|NilClass
Retrieves the next item in the list of suggestions.
253 254 255 256 |
# File 'lib/ffi/aspell/aspell.rb', line 253 attach_function 'string_enumeration_next', 'aspell_string_enumeration_next', [:pointer], :string |
.word_list_elements(suggestions) ⇒ FFI::Pointer
Returns a pointer to a list which can be used by string_enumeration_next to retrieve all the suggested words.
211 212 213 214 |
# File 'lib/ffi/aspell/aspell.rb', line 211 attach_function 'word_list_elements', 'aspell_word_list_elements', [:pointer], :pointer |
Instance Method Details
#speller_suggest(speller, word, length) ⇒ FFI::Pointer
Returns a pointer that can be used to retrieve a list of suggestions for a given word.
196 197 198 199 |
# File 'lib/ffi/aspell/aspell.rb', line 196 attach_function 'speller_suggest', 'aspell_speller_suggest', [:pointer, :string, :int], :pointer |