?
Solved

Spell Checking in VB.NET

Posted on 2007-07-28
11
Medium Priority
?
988 Views
Last Modified: 2013-11-26
Hi,

I have an application where a user types text into a TextBox, ranging anywhere from a simple sentence to a full page of text. Usuallly its a few paragraphs equalling about half a page. In any event, I would like to provide the user with the ability to "spell check" what they've typed rather than just saving the text into their database verbatim.

Is there a way to provide this type of functionality with Visual Studios 2005 (Visual Basics.NET)?

Thanks,
FDT
 
0
Comment
Question by:Mr_Fulano
  • 5
  • 5
11 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19586703
There isn't a native class that provides this functionality in the .NET framework, so you would have to find a 3rd party component.

Bob
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 400 total points
ID: 19586821
see ultimate spell at http://www.karamasoft.com/
0
 

Author Comment

by:Mr_Fulano
ID: 19587184
Thanks for the feedback.  UltimateSpell seems to be a really cool application for $249.00. However, I think its for ASP.NET only.  I'm developing a regular EXE that will not be web based.

I assume building a simple (...very simple) spell checker is nothing more than building a Do While loop that goes through the text word-by-word and compares each word it finds to a list.  So, if I decided to build my own spell checker, where could I find a dictionary list of words for free?

Has anyone tried to build a (simple) spell checker and can provide some tips?

Thanks,
FDT

0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:Mr_Fulano
ID: 19587366
Gentlemen, I found a list of words that will work as a dictionary list.  

Could you please offer some help on how to design the spell checker code?  A simple example to get me started would be great.  My thoughts are that I would be searching a "Textbox" one word at a time and comparing that word (which I would put in a String variable) to my list of dictionary words. If the word is spelled correctly it would continue. If the word is spelled incorrectly (i.e no exact match found), it would give the user a list of "close choices".  

How would you work the logic for "close choices"?

Say I misspelled the word drive by typing "dribe"  I'd like the close choices to be
...drive, driver, driving...etc (or something logical).  How would my code know that the user means "drive", so that it could give the user those choices and not ...dryer, draw, drawing, drinking, etc?

Thanks,
FDT
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19588068
There are reasons why I don't try to create a spell checker--everyone has.

Call Word to spell check from Visual Basic .NET
http://www.vb-helper.com/howto_net_spellcheck.html

Bob
0
 

Author Comment

by:Mr_Fulano
ID: 19588892
Hi TheLearnedOne,

I agree with your position that adding a reference to say "Microsoft Word 11.0 Object Library" (or whatever version one has) is by far a better choice. However, lets assume a situation where the user does not have Microsoft Office loaded on the computer running my application (which in my case may be a possibility). If I added the reference and my application could not find Microsoft Office on their machine, my application would crash (or in the very least, not perform the spell checking procedure). -- Unless that is, that I'm misunderstanding how references work and once a reference is added it does not need the actual application to work, which I don't believe to be the case (I may be wrong).  

Therefore, that's the reason I'd like to create my own simple version. I know its not a trivial matter and that's why I'm seeking guidance. I also know its not the most advisable choice, given that a "reference" to a COM library is by far easier and more efficient, but I'm between the proverbial rock and a hard place given that I cannot assume my users will all have MS Office (as common as it is).

If you can point me to a generic example of a non-ASP spell checker that I can get some ideas, I'd greatly appreciate it. As you stated, everyone has at one time or another tried to create a spell checker, I simply need a sample of one that I can use to check spelling inside a textbox.

Thanks for you continued support!
FDT
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19591859
You could try NetSpell:

NetSpell - .net Spell Checker
http://sourceforge.net/projects/netspell/

NetSpell is a free spell checking engine for the .net framework.

Bob
0
 

Author Comment

by:Mr_Fulano
ID: 19596930
Hi TLO, first and foremost, thank you for taking the time to find me a free SpellChecker. I appreciate your the effort and in looking at their web site, I learned a little about how these applications are designed.

However, let me share with you some of my thoughts on this...I'm interested in writing my own SpellChecker for a couple of reasons, one of them being that I want to learn from the experience. If I just copy some code, I learned very little or nothing at all.

Whenever I take on a project, as small or as large as it may be, I always try to learn why things didn't work or why they actually do and I always try to learn from my mistakes -- and I'm sure a SpellChecker will do wonders for that concept.

Throughout the time I've been a member here, I've learned an enormous amount, and although I'm not a master programmer like you, FernandoSoto,   IdleMind, or some of the others, but I have come a long way by trying to study other persons coding styles.

As for the SpellChecker -- I have a rough draft of what my methodology might be and I'm going to at least try. It may be an average outcome, or maybe it won't work at all, but I can guarantee you one thing... I will learn at least one programming technique from the process.

Having said that, I thank you for your contribution and believe it or not, I did pick up a couple of tips from the NetSpell website.

Thanks again,
Fulano

0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1600 total points
ID: 19597318
Do you know anything about Soundex or Metaphone?

How to write a spellchecker
http://author.handalak.com/archives/042003/000078

Bob
0
 

Author Comment

by:Mr_Fulano
ID: 19597679
Hi Bob,

Thanks for the info. As you can see, I just learned something new....man I love this programming stuff...LOL.

The info you provided gave me some ideas. I'm going to try them out and see how far I get. Thanks again.

I increased the points to 500 (Max) and split them 400/100 between you (400) and emoreous (100), as he did try to help.

Thanks again,
Fulano.

BTW, what ever happend to your attempt at a spell checker?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19598852
>>BTW, what ever happend to your attempt at a spell checker?
I never have tried.

Bob
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question