SpellCheck lib/include (32bit and 64bit) - hunspell wrapper

Share your advanced PureBasic knowledge/code with the community.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrap

Post by Fangbeast »

Yes, it works. (has the British and US spelling libraries included)... but absolutely no Aussie slang. :mrgreen:
Maaaaaate!! Fair suck of the sav!! I'll take a beak at it, wotcha!

Just realised that it's a userlib and that may break between pb versions so I am too scared to try it! PrincieD hasn't been around in ages in case something goes wrong and I wouldn't be able to fix it.
Amateur Radio, D-STAR/VK3HAF
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrap

Post by blueb »

Fangbeast wrote: Just realised that it's a userlib and that may break between pb versions so I am too scared to try it! PrincieD hasn't been around in ages in case something goes wrong and I wouldn't be able to fix it.
Not quite correct....

You're not forced to use the UserLib version. If you want to use the source code version, modify the example like this...

Code: Select all

XIncludeFile "Source\SpellCheck.pbi"
Now the example will use the include file.

blueb
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrap

Post by Fangbeast »

Not quite correct....
That's normal for me!!

Code: Select all

XIncludeFile "Source\SpellCheck.pbi"
That's what I get for not having a quick look, too busy being tired:):)

Will be able to play tonight when the family is asleep.

By the way, I did see an Australian dictionary somewhere, just can't remember where that was on my travels.
Amateur Radio, D-STAR/VK3HAF
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrap

Post by Little John »

This is exactly what I need.
Thank you so much, Chris!
XCoder
User
User
Posts: 68
Joined: Tue Dec 31, 2013 9:18 pm

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrap

Post by XCoder »

Thanks, PrincieD.

I have posted a spelling checker that uses your library at viewtopic.php?f=12&t=76205. This underlines mispelt words with a red wavy line.
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 223
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrapper

Post by DeanH »

XCoder, I have downloaded and tried the basic SpellChecker. It works well in 32-bit PureBasic 5.73 and 6.00 (beta 6) but crashes for me in 64-bit. I'm running Windows 10.

An "Assembler error" messagebox appears with:
purebasic.asm [783];
mov, dx, [p.p_theString]
processed: mov rdx, [p.p_theString]
error: undefined symbol 'p.p_theString'.

My knowledge of assembly is woeful. Would you be able to look into it?
Thanks.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrapper

Post by Paul »

DeanH wrote: Tue Apr 05, 2022 4:38 am It works well in 32-bit PureBasic 5.73 and 6.00 (beta 6) but crashes for me in 64-bit. I'm running Windows 10.
Modify the IsAlpha() procedure and change the line containing...

Code: Select all

!mov rdx, [p.p_theString]
to this...

Code: Select all

!mov rdx, [p.p_character]
Image Image
XCoder
User
User
Posts: 68
Joined: Tue Dec 31, 2013 9:18 pm

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrapper

Post by XCoder »

Thanks for pointing out the bug. I have updated the code for the spelling checker and put the link to the updated code in my original post at https://www.purebasic.fr/english/viewto ... 92#p582792
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 223
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: SpellCheck lib/include (32bit and 64bit) - hunspell wrapper

Post by DeanH »

Thanks. That fixed it.
Post Reply