Post by Nathan Lecompte on Feb 22, 2014 11:58:10 GMT 10
Simple SpellCheckerDownload Source Code: TechViewHD SpellChecker.zip (3.37 MB)IntroductionThis will show you a simple SpellChecking engine for your VB.NET application. Implementing the control1. When you have successfully downloaded the source code, inside the folder look for the following file's: "TechViewHD.SpellChecker.dll" "en-AU.dic" (or you can select a different dictionary if you want it to check in a different language)2. Add the DLL to Visual Studio or Visual Basic by going to your Toolbox > Right mouse click > Choose items > Press "Browse..." > Select the DLL shown above. 3. For the SpellChecker to work you will have to insert the following controls: "Spelling" "WordDictionary" "Timer"NOTE: ADD THE "en-AU.dic" FILE TO YOUR OUTPUT FOLDER (E.G. BIN FOLDER or OBJ FOLDER or THE FOLDER CONTAINING THE MAIN .EXE FILE). Using the codeSome things which you'll have to add in order for it to work: Replace Word Event
You use this: Private Sub SpellChecker_ReplacedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.ReplaceWordEventArgs) Handles Spelling1.ReplacedWord 'When replacing a word in the SpellCheck Dialog Dim start As Integer = Me.YOURRICHTEXTBOX.SelectionStart Dim length As Integer = Me.YOURRICHTEXTBOX.SelectionLength Me.YOURRICHTEXTBOX.Select(e.TextIndex, e.Word.Length) Me.YOURRICHTEXTBOX.SelectedText = e.ReplacementWord If ((start + length) > Me.YOURRICHTEXTBOX.Text.Length) Then length = 0 End If Me.YOURRICHTEXTBOX.Select(start, length) End Sub
Delete Word Event
You use this: Private Sub SpellChecker_DeletedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.SpellingEventArgs) Handles Spelling1.DeletedWord 'When deleting a word in the SpellCheck Dialog Dim start As Integer = Me.YOURRICHTEXTBOX.SelectionStart Dim length As Integer = Me.YOURRICHTEXTBOX.SelectionLength Me.YOURRICHTEXTBOX.Select(e.TextIndex, e.Word.Length) Me.YOURRICHTEXTBOX.SelectedText = "" If ((start + length) > Me.YOURRICHTEXTBOX.Text.Length) Then length = 0 End If Me.YOURRICHTEXTBOX.Select(start, length) End Sub When "SpellCheck" button pressed Spelling1.SpellCheck() Timer Tick EventSpelling1.Text = YOURRICHTEXTBOX.Text() Final Steps1. Go to properties of Spelling1 and set "Dictionary" to "WordDictionary1". 2. Go to properties of WordDictionary1 and set "DictionaryFile" to the name of the .DIC file you selected and added to your output folder (Example: en-AU.dic). 3. Enjoy! OverviewThis is a great little SpellChecking component and is very easy to use. I hope you found this article interesting!
|
|
Post by jerichofalls on May 1, 2014 6:59:00 GMT 10
Is the code used in the .dll a trade secret? I'd be interested to know what it is like... I'm intrigued into what is stored in the .dll - is it the dictionary, or the coding to an online dictionary resource or something - I'm pretty sure you haven't added every word in the dictionary. Also, does the .dll file learn from text entry?
|
|
Post by Nathan Lecompte on May 1, 2014 19:07:29 GMT 10
Is the code used in the .dll a trade secret? I'd be interested to know what it is like... I'm intrigued into what is stored in the .dll - is it the dictionary, or the coding to an online dictionary resource or something - I'm pretty sure you haven't added every word in the dictionary. Also, does the .dll file learn from text entry? The .dll contains a simple form which can add, remove and compare words to the ones of the desired string (richtextbox etc.). The dictionary is the en-AU.dic file, it contains a list of words from the english dictionary (made and provided by OpenOffice, they also provide other dictionaries on their website). The code in the .dll is simple and can be made by anyone, this is just something simple I put together. PS: It's by far impossible to add all english words because there are new words being made every-day! Hope this helps!
|
|
Post by Makan on May 11, 2014 9:57:10 GMT 10
|
|
Post by Nathan Lecompte on Jul 3, 2014 20:02:57 GMT 10
Sadly, no. I'm not planning on expanding this component anytime soon :/ , maybe in the near future.
|
|
Post by btechuk on May 12, 2015 8:12:31 GMT 10
Don't get me wrong, I'm glad you're opening people's eyes to a brilliant feature that we could see in future notepad applications but, what was the point in renaming the NetSpell component as your own? The dictionaries are also the ones provided by the original coder, as when they're loaded into notepad you can see they're copyrighted along with information by the original coder himself.
|
|
Post by Nathan Lecompte on May 12, 2015 11:04:11 GMT 10
Yes I know, I tweaked it a little (cleaned up the code a bit and slightly improved the dialog design), however I made sure that the copyright is still to the original owner (this is basically sort of like a remake/remix). Development for this component stopped a while back and I thought it'd be good to update it a little, hope you understand
|
|
Post by btechuk on May 13, 2015 4:26:12 GMT 10
Ah ok, I might try it out soon
|
|