world.AddSpellCheckWord

MUSHclient script function (Method) — introduced in version 3.74

Adds a word to the user spell check dictionary

Prototype

long AddSpellCheckWord(BSTR OriginalWord, BSTR ActionCode, BSTR ReplacementWord);

Data type meanings

Description

This lets you add a word to the spell checker "user dictionary" from within a script.

Usage:

result = AddSpellCheckWord (original_word, action, replacement)

original_word = word to match on

action = one of the following single characters (case-sensitive):

'a' = The word should be unconditionally substituted for another word; the substitution should use the case pattern as listed in the lexicon.

'A' = The word should be unconditionally substituted for another word; the substitution should use the case pattern of the original word.

'c' = The word should be conditionally substituted for another word; the substitution should use the case pattern as listed in the lexicon.

'C' = The word should be conditionally substituted for another word; the substitution should use the case pattern of the original word.

'e' = The word should be treated as misspelled by the spell checker, even if it is defined in other lexicons.

'i' = The word should be ignored (skipped) because it is considered correctly spelled.

replacement = the word to replace (or suggest a replacement for) the original word

eg.

AddSpellCheckWord ("foo", "A", "bar") --> convert "foo" to "bar"
AddSpellCheckWord ("colour", "i", "") --> "colour" is spelt correctly

VBscript example

AddSpellCheckWord "foo", "A", "bar"  ' convert "foo" to "bar"
AddSpellCheckWord "colour", "i", ""  ' "colour" is spelt correctly

Lua example

AddSpellCheckWord ("foo", "A", "bar")  --> convert "foo" to "bar"
AddSpellCheckWord ("colour", "i", "")  --> "colour" is spelt correctly

Lua notes

The third argument (replacement word) is optional and defaults to an empty string.

Return value

eSpellCheckNotActive - spell checker not enabled or could not be opened

eBadParameter -

original_word not supplied or too long (more than 63 characters); or
replacement word too long (more than 63 characters); or
error returned from spell-check engine

eUnknownOption - action code not in the above list

eOK - did it OK

Return code meanings

Related topic

Spell checker

See also

FunctionDescription
SpellCheckSpell checks an arbitrary string of text
SpellCheckCommandSpell checks the text in the command window