EN6_PRC8/_module/nss/nwnx_spellcheck.nss
Jaysyn904 a6f6db7303 Initial commit
Initial commit.  Updated release archive.
2024-06-13 15:08:33 -04:00

44 lines
1.7 KiB
Plaintext

/// @addtogroup spellchecker SpellChecker
/// @brief Functions related to spellchecking
/// @{
/// @file nwnx_spellcheck.nss
#include "nwnx"
const string NWNX_SpellChecker = "NWNX_SpellChecker"; ///< @private
/// @brief Finds misspells in a string.
/// @param sentence The sentence to check.
/// @return The spelling mistakes in the sentence, comma delimited. Returns blank if no errors or if .so file
/// is improperly installed.
/// @note If it returns an error in every word, even when spelled correctly, the dictionary is not set up correctly.
/// @warning These functions can be performance heavy, do limit how many calls and/or how long of a sentence is passed.
/// Make use of **DelayCommands** and **AssignCommands**
string NWNX_SpellChecker_FindMisspell(string sentence);
/// @brief Get suggestions on a single word, comma delimited.
/// @param word The string to check for suggestions.
/// @return A comma delimited lists of suggestions for a word. Returns blank if no errors or if .so file is improperly
/// installed.
/// @warning These functions can be performance heavy, do limit how many calls and/or how long of a sentence is passed.
/// Make use of **DelayCommands** and **AssignCommands**
string NWNX_SpellChecker_GetSuggestSpell(string word);
/// @}
string NWNX_SpellChecker_FindMisspell(string sentence)
{
string sFunc = "FindMisspell";
NWNX_PushArgumentString(sentence);
NWNX_CallFunction(NWNX_SpellChecker, sFunc);
return NWNX_GetReturnValueString();
}
string NWNX_SpellChecker_GetSuggestSpell(string word)
{
string sFunc = "GetSuggestSpell";
NWNX_PushArgumentString(word);
NWNX_CallFunction(NWNX_SpellChecker, sFunc);
return NWNX_GetReturnValueString();
}