Spell Checker

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Spell Checker

Post by Paul »

Needed a spell checker for a project I was working on but could not find a free one on the web anywhere (there where quite a few for $$$). I decided to quickly whip one up in PureBasic. It worked quite well for what I needed so I have made it available for others to use also. I compiled it as a handy DLL so it can be used in other languages besides PB.

DLL Archive... Dictionary.zip
Image Image
User avatar
J. Baker
Addict
Addict
Posts: 2185
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Nice work Paul, I'm sure this will come in handy. :D
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

thanks! its really nice!.

Btw, how does it work? It takes word for word and then
compares with a database, and if word is not in database it complains?



btw i found 2 small bugs:

1)
type in "worrld" (yes world with 2 r's)
ok it should complain and it does..
if you correct the mistake and write more after the word "world", so there
stands "world is sleeping", then all is highligted.

2)
any number you write it takes as an spelling error.


(want to share the source, or keep it private?)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Spell Checker

Post by NoahPhense »

Nice work. How about a userlib with now msgbox at the end, and a data
file so that words can be added/removed from the list?

- np
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

thefool wrote: btw i found 2 small bugs:

1)
type in "worrld" (yes world with 2 r's)
ok it should complain and it does..
if you correct the mistake and write more after the word "world", so there
stands "world is sleeping", then all is highligted.
Not a bug.
Did you press the "spellcheck" button after you made your changes?
The example program performs a spell check when the "spellcheck" button is pressed. If you want the program to check as you type, you have to adjust the code accordingly.


2)
any number you write it takes as an spelling error.
Not a bug.
This is a spell checker, it checks the spelling of words.
"Two" is a word... "2" is not a word.
All numbers will show as spelling errors because they are not words. If you want to check the spelling of a number, then type the number as a word ;)

How about a userlib with now msgbox at the end, and a data
file so that words can be added/removed from the list?
A 400kb user library?? Little excessive don't you think ?!?
DLL's are accepted as excess baggage, especially in this type of situation.

I posted a newer version that allows for an external dictionary file so you can add your own words. Keep in mind that the DLL is optimized for its own built in dictionary (over 110,000 words)... any extra dictionary data will slow the checking process down. (especially if the extra dictionary file grows to a large size)


Enjoy! :)
Image Image
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

I didn't mean to make the words part of the lib.. Just the core. Then the
data file can be the baggage.

Just a thought.

- np
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

Paul, just a heads up. It seems I have found an anamoly with Dictionary_SOWPODS.dll.

I typed the following:

H man! What it be?

As you can see "H" is not a word and the spell checker did not catch such.

Sincerely,
Intrigued - Registered PureBasic, lifetime updates user
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Now this will come in handy!

Thanks Paul.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Excellent work Paul.

btw, how did you compile the dictionary? I'm not suggesting for a mo that you typed in 110000 words... :D

Thanks.
I may look like a mule, but I'm not a complete ass.
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

It's a great work. But I'm looking for a german spellchecker. Is it possible to change the internal dictionary to an external dictionary to use the lib with other languages. Perhaps the source-code could be helpfull too, to create a german dictionary. :wink:
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply