HunspellLibrary

interface HunspellLibrary : Library(source)

JNA bindings for the Hunspell spell checking library.

Hunspell is the most widely used spell checker on Linux systems. It's used by LibreOffice, Firefox, Chrome, and many other applications.

Reference: https://github.com/hunspell/hunspell/blob/master/src/hunspell/hunspell.h

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun Hunspell_add(pHunspell: Pointer, word: String): Int

Adds a word to the runtime dictionary. The word is only remembered for this session and not persisted.

Link copied to clipboard
abstract fun Hunspell_add_with_affix(pHunspell: Pointer, word: String, flags: String): Int

Adds a word with affix flags to the runtime dictionary.

Link copied to clipboard
abstract fun Hunspell_create(affpath: String, dpath: String): Pointer?

Creates a new Hunspell instance from dictionary files.

Link copied to clipboard
abstract fun Hunspell_create_key(affpath: String, dpath: String, key: String?): Pointer?

Creates a new Hunspell instance from dictionary files with a custom key.

Link copied to clipboard
abstract fun Hunspell_destroy(pHunspell: Pointer)

Destroys a Hunspell instance and frees all resources.

Link copied to clipboard
abstract fun Hunspell_free_list(pHunspell: Pointer, slst: PointerByReference, n: Int)

Frees a list of suggestions returned by Hunspell_suggest.

Link copied to clipboard
abstract fun Hunspell_get_dic_encoding(pHunspell: Pointer): String?

Gets the dictionary encoding.

Link copied to clipboard
abstract fun Hunspell_remove(pHunspell: Pointer, word: String): Int

Removes a word from the runtime dictionary.

Link copied to clipboard
abstract fun Hunspell_spell(pHunspell: Pointer, word: String): Int

Checks if a word is spelled correctly.

Link copied to clipboard
abstract fun Hunspell_suggest(pHunspell: Pointer, slst: PointerByReference, word: String): Int

Gets spelling suggestions for a word.