Spell

Spellchecking using Hunspell

Summary
SpellSpellchecking using Hunspell
GetEncodingGet dictonary encoding
InitInitialise the spellcheck engine
PutWordAdd word to dictionary.
SpellSpellcheck word
SuggestSuggest words for word
UnintUninitialise the spellcheck engine
Example
About

GetEncoding

Spell_GetEncoding(hSpell)

Get dictonary encoding

Init

Spell_Init(aff,
dic)

Initialise the spellcheck engine

Parameters

affPath to affinity file
dicPath to dictionary file

Returns

Handle to the spell object.

PutWord

Spell_PutWord(hSpell,
word)

Add word to dictionary.  Word is valid until spell object is not destroyed

Spell

Spell_Spell(hSPell,
word)

Spellcheck word

Returns

True or False

Suggest

Spell_Suggest( hSpell,
 word,
ByRef sList)

Suggest words for word

Parameters

wordWord for which to look up for suggestions
sListReference to variable to recive suggestion word list

Returns

Number of words in sList

Unint

Uninitialise the spellcheck engine

Example

  word = autohotkey

  hSpell := Spell_Init("dic\en_US.aff", "dic\en_US.dic")
  if Spell_Spell(hSpell, word)
      msgbox OK
  else {
      cnt := Spell_Suggest(hSPell, word, lst)
      msgbox %cnt%`n`n%lst%
  }

  Spell_Uninit( hSpell )
return
Spell_GetEncoding(hSpell)
Get dictonary encoding
Spell_Init(aff,
dic)
Initialise the spellcheck engine
Spell_PutWord(hSpell,
word)
Add word to dictionary.
Spell_Spell(hSPell,
word)
Spellcheck word
Spell_Suggest( hSpell,
 word,
ByRef sList)
Suggest words for word
Close