I've wrote a nice simple little SpellCheck library/include for Windows that wraps hunspell (compiles for both x86 and x64), based on the original thread here: http://www.purebasic.fr/english/viewtop ... =7&t=43739
Hunspell uses UTF8 encoding for unicode strings and I've modified the library accordingly
SpellCheck Library - 32bit/64bit Userlibs, pre-compiled Hunspellx86.dll/Hunspellx64.dll (V1.3.2 - Latest), dictionaries (US/UK English), source and example.
http://www.progui.co.uk/downloads/SpellCheck.zip
Commands in the Lib
SpellCheck_Dictionary(dicPath.s) ; Sets the current dictionary, returns nonzero if successful
SpellCheck(word.s) ; Checks spelling of specified word, returns true if correct spelling, false otherwise
SpellCheck_Suggest(word.s) ; Offers suggestions for a word, returns string containing comma separated list
SpellCheck_Ignore(word.s) ; Adds a new temporary word to the current spellcheck session, having the effect of ignoring the specified word
SpellCheck_Add(word.s) ; Adds a new word to the custom user dictionary of the currently opened dictionary
More dictionary files for different languages can be downloaded here: http://wiki.services.openoffice.org/wiki/Dictionaries
Please feel free to modify/improve/use as you want
Example
Code: Select all
SpellCheck_Dictionary("Dictionaries\en_GB.dic")
If SpellCheck("imagination")
Debug "spelling correct"
Else
Debug "spelling wrong!"
EndIf
suggestions$ = SpellCheck_Suggest("imagintaion")
If suggestions$ <> ""
i = CountString(suggestions$, ",")
For n = 1 To i+1
Debug StringField(suggestions$, n, ",")
Next
Else
Debug "no suggestions!"
EndIf
Chris.