Revision history for ExtLibaspell


Revision [22471]

Last edited on 2018-09-03 16:39:38 by JeffMarshall [small fix to compile example]
Additions:
#include Once "aspell.bi"
Dim As AspellConfig Ptr spell_config = new_aspell_config()
Dim As AspellCanHaveError Ptr possible_err = new_aspell_speller(spell_config)
If (aspell_error_number(possible_err) <> 0) Then
Print *aspell_error_message(possible_err)
End 1
End If
Dim As AspellSpeller Ptr speller = to_aspell_speller(possible_err)
Dim As String word
Do
Print
Input "Enter a word (blank to quit): ", word
If (Len(word) = 0) Then
Exit Do
End If
If (aspell_speller_check(speller, StrPtr(word), Len(word)) <> 0) Then
Print "Word is Correct"
Else
Print "Suggestions:"
Dim As AspellStringEnumeration Ptr elements = _
aspell_word_list_elements(aspell_speller_suggest(speller, StrPtr(word), Len(word)))
Do
Dim As const ZString Ptr w = aspell_string_enumeration_next(elements)
If (w = 0) Then
Exit Do
End If
Print " "; *w
Loop
End If
Loop
Deletions:
#include once "aspell.bi"
dim as AspellConfig ptr spell_config = new_aspell_config()
dim as AspellCanHaveError ptr possible_err = new_aspell_speller(spell_config)
if (aspell_error_number(possible_err) <> 0) then
print *aspell_error_message(possible_err)
end 1
end if
dim as AspellSpeller ptr speller = to_aspell_speller(possible_err)
dim as string word
do
print
input "Enter a word (blank to quit): ", word
if (len(word) = 0) then
exit do
end if
if (aspell_speller_check(speller, strptr(word), len(word)) <> 0) then
print "Word is Correct"
else
print "Suggestions:"
dim as AspellStringEnumeration ptr elements = _
aspell_word_list_elements(aspell_speller_suggest(speller, strptr(word), len(word)))
do
dim as zstring ptr w = aspell_string_enumeration_next(elements)
if (w = 0) then
exit do
end if
print " "; *w
loop
end if
loop


Revision [17709]

Edited on 2015-07-01 08:15:02 by DkLwikki [Updated in Git]
Additions:
Header version: 0.60.6.1
Deletions:
Header version: 0.50


Revision [15915]

Edited on 2012-02-02 10:06:05 by DkLwikki [Add version]
Additions:
Headers to include: aspell.bi
Deletions:
Headers to include: ##aspell.bi##


Revision [15914]

Edited on 2012-02-02 10:05:49 by DkLwikki [Add version]
Additions:
Headers to include: ##aspell.bi##
Header version: 0.50
Deletions:
Headers to include: aspell.bi


Revision [15343]

Edited on 2011-10-03 17:12:26 by CountingPine [Remove CamelCase link]
Additions:
Platforms supported: ""Win32"", Linux
Deletions:
Platforms supported: Win32, Linux


Revision [15340]

Edited on 2011-10-03 08:39:50 by DkLwikki [Add example]
Additions:
{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/libraries/aspell.bas"}}%%(freebasic)
'' GNU-ASspell example, converted from http://aspell.net/win32/
#include once "aspell.bi"
dim as AspellConfig ptr spell_config = new_aspell_config()
'' Change this to suit the installed dictionary language if desired
aspell_config_replace(spell_config, "lang", "en_CA")
'' Create speller object
dim as AspellCanHaveError ptr possible_err = new_aspell_speller(spell_config)
if (aspell_error_number(possible_err) <> 0) then
print *aspell_error_message(possible_err)
end 1
end if
dim as AspellSpeller ptr speller = to_aspell_speller(possible_err)
dim as string word
do
print
input "Enter a word (blank to quit): ", word
if (len(word) = 0) then
exit do
end if
if (aspell_speller_check(speller, strptr(word), len(word)) <> 0) then
print "Word is Correct"
else
print "Suggestions:"
dim as AspellStringEnumeration ptr elements = _
aspell_word_list_elements(aspell_speller_suggest(speller, strptr(word), len(word)))
do
dim as zstring ptr w = aspell_string_enumeration_next(elements)
if (w = 0) then
exit do
end if
print " "; *w
loop
delete_aspell_string_enumeration(elements)
end if
' - Report the replacement
'aspell_speller_store_repl(speller, misspelled_word, size,
' correctly_spelled_word, size);
' - Add to session or personal dictionary
'aspell_speller_add_to_session|personal(speller, word, size)
loop
delete_aspell_speller(speller)
%%
Deletions:
Version: 0.50
Example included: yes, in examples/libraries/ASpell/aspell_test.bas


Revision [12742]

The oldest known version of this page was created on 2008-03-21 07:28:45 by JeffMarshall [Add example]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode