Module: FFI::Aspell
- Extended by:
- Library
- Defined in:
- lib/ffi/aspell.rb,
lib/ffi/aspell/error.rb,
lib/ffi/aspell/speller.rb,
lib/ffi/aspell/version.rb
Overview
Defined Under Namespace
Classes: ConfigError, Speller
Constant Summary collapse
- VERSION =
'0.0.3'
Class Method Summary collapse
-
.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.
-
.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_new ⇒ FFI::Pointer
Creates a pointer for a configuration struct.
35 36 37 38 |
# File 'lib/ffi/aspell.rb', line 35 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.
113 114 115 116 |
# File 'lib/ffi/aspell.rb', line 113 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.
91 92 93 94 |
# File 'lib/ffi/aspell.rb', line 91 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.
57 58 59 60 |
# File 'lib/ffi/aspell.rb', line 57 attach_function 'config_retrieve', 'aspell_config_retrieve', [:pointer, :string], :string |
.config_retrieve_default(config, key) ⇒ Object
Retrieves the default value of a configuration item.
70 71 72 73 |
# File 'lib/ffi/aspell.rb', line 70 attach_function 'config_retrieve_default', 'aspell_config_get_default', [:pointer, :string], :string |
.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.
177 178 179 180 |
# File 'lib/ffi/aspell.rb', line 177 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.
148 149 150 151 |
# File 'lib/ffi/aspell.rb', line 148 attach_function 'speller_delete', 'delete_aspell_speller', [:pointer], :void |
.speller_new(config) ⇒ FFI::Pointer
Creates a pointer to a speller struct.
134 135 136 137 |
# File 'lib/ffi/aspell.rb', line 134 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.
224 225 226 227 |
# File 'lib/ffi/aspell.rb', line 224 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.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.
209 210 211 212 |
# File 'lib/ffi/aspell.rb', line 209 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.
193 194 195 196 |
# File 'lib/ffi/aspell.rb', line 193 attach_function 'speller_suggest', 'aspell_speller_suggest', [:pointer, :string, :int], :pointer |