Script function
world.AddSpellCheckWord
Read about scripting
Type
Method
Summary
Adds a word to the user spell check dictionary
Prototype
long AddSpellCheckWord(BSTR OriginalWord, BSTR ActionCode, BSTR ReplacementWord);
View list of 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
Available in MUSHclient version 3.74 onwards.
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
View list of return code meanings
See Also ...
Topic
Spell checker
Functions
(SpellCheck) Spell checks an arbitrary string of text
(SpellCheckCommand) Spell checks the text in the command window
(SpellCheckDlg) Spell checks an arbitrary string of text, invloking the spell-checker dialog
(Help topic: function=AddSpellCheckWord)