#include "windows.bi"
#include "hunspell.bi"

    dim as Hunhandle ptr enuSpellObj = Hunspell_create("dic\\en_us.aff", "dic\\en_us.dic")
if enuSpellObj = 0 then
end
end if

    dim as Hunhandle ptr ruSpellObj = Hunspell_create("dic\\ru_RU.aff", "dic\\ru_RU.dic")

dim st as string * 60

print "Hunspell english us dic encoding: ";*Hunspell_get_dic_encoding(enuSpellObj)
print "Hunspell russian us dic encoding: ";*Hunspell_get_dic_encoding(ruSpellObj)
    input "enter english word",st

if st <> "" then 
    dim as integer result = hunspell_spell(enuSpellObj, strptr(st))

    if(result = 0) then
print "Spelling error!"
    else
print "Correct Spelling!"
end if
end if

st = ""
input "Enter russian word",st
if st <> "" then
OemToChar(strptr(st),strptr(st))
    dim as integer result = hunspell_spell(ruSpellObj, strptr(st))

    if(result = 0) then
print "Spelling error!"
    else
print "Correct Spelling!"
end if
end if


    Hunspell_destroy(ruSpellObj)
    Hunspell_destroy(enuSpellObj)
print "press any key"
sleep