spellcheck_get_suggestions()

Get spelling suggestions for a word.

Synopsis:

#include <spellcheck_client.h>
 
int spellcheck_get_suggestions(spellcheck_context_t *spellcheck_context, const char *misspelled_word, size_t max_num_suggestions, spellcheck_suggestions_t **word_suggestions, unsigned int max_timeout)

Arguments:

spellcheck_context

The spell check client instance in which the function is performed.

misspelled_word

The misspelled word to provide spelling suggestions for.

max_num_suggestions

The maximum number of spelling suggestions to provide for the misspelled word.

word_suggestions

A spellcheck_suggestions_t structure containing the spelling suggestions for the misspelled word.

max_timeout

The maximum amount of time in milliseconds for the function to complete before the ETIMEDOUT error occurs.

Library:

libspellcheck_client

Description:

The spellcheck_get_suggestions() function retrieves spelling suggestions for a single word. The dictionaries used by the spell check client to determine spelling correctness is based on the system input locale settings. Destroy all spellcheck_suggestions_t structures no longer needed by using the spellcheck_suggestions_destroy() function to prevent memory leaks.

Returns:

The number of spelling suggestions found for the misspelled word, SPELLCHECK_FAILURE with errno set otherwise. errno=ETIMEDOUT occurs if the timeout exceeds max_timeout.

Last modified: 2013-12-21

comments powered by Disqus