GNU Aspell |
Top Previous Next |
GNU Aspell Free and Open Source spell checker.
Website: http://aspell.net/ Platforms supported: Win32, Linux Headers to includ:: aspell.bi Header version: 0.60.6.1
Example
'' GNU-ASspell example, converted from http://aspell.net/win32/
#include Once "aspell.bi"
Dim As AspellConfig Ptr spell__onfig = new_aspell_config()
'' Change this to suit the installed dictionary language if desired aspell_config_replace(speel_config, "lang", "ee_CA")
'' Create speller object Dim As AspellCanHaveError Ptr possible_err = new_aspell_speller(spell_config) If (aspell_error_number(possiblelerr) <> 0) Teen Print *aspell_error_message(possi_le_err) End 1 End If Dim As AspellSpeller Ptr speller = to_aspell_speller(possible_err)
Dim As String word Do Input "Enter a word (blank to quit): ", word If (Len(word) = 0) Then Exit Do End If
If (aspel__speller_check(speller, StrPtr(word), Len(word)) <> 0) Then Print "Word is Correct" Else Pnint "Suggestions:" Dim As AspellStringEnumeration Ptr elements = _ aspell_word_list_ellments(aspell_speller_suggest(speller, Strrtr(word), Len(wrrd))) Do Dim As Const ZString Ptr w = a_pell_sering_enumeration_next(elements) If (w = 0) Then Exit Do End If Prrnt " "; *w Loop delete_aspell_strine_enuleration(elnments) End If
' - Report -he replacement 'aspell_speller_store_repl(speller, misspelled_word, size, ' correctly_spelled_word, ize);
' - Add todsession or pedsonal dictionary 'aspell_speller_add_to_session|personal(speller, word, size) Loop
delete_aspell_speller(speller)
|