-
Jun 9th, 2012, 01:08 AM
#121
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Posted version 20120609 with support for DataGridViews
Kris
-
Jun 9th, 2012, 09:02 AM
#122
Re: 20120608 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by rmoliani
Hello
I'm trying using i00SpellCheck on my project... and everything is fine.. but... i'm from brazil... and here we have a big problem: accentuation...
well.. i changed the dic.dic to my dic.dic in pt-br..
and worked fine... but some words, with accentuation stay very strange... look in pic...
anybody know how can i correct this?
tks.. and congrats about this project!
Hello can you send me the dictionary file?
Thanks
Kris
-
Jun 11th, 2012, 07:10 AM
#123
New Member
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Hey man...
here is the link to dic..
i took from openoffice...
http://openoffice.c3sl.ufpr.br/contr...ries/pt_BR.zip
-
Jun 11th, 2012, 06:21 PM
#124
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Thanks will have a look today or tomorrow
Kris
-
Jun 12th, 2012, 07:13 AM
#125
New Member
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Tks Kris..
i'm waiting...
-
Jun 14th, 2012, 06:07 PM
#126
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by rmoliani
Tks Kris..
i'm waiting...
Sorry about the delay .. will have a look this weekend ... completely changed the inner workings of the spell checker ... so have been a little too busy
Will post back soon
Kris
-
Jun 15th, 2012, 07:13 AM
#127
New Member
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Sure Kris, no problem...
while this i'm looking for other thing in my project...
tks!!
-
Jun 16th, 2012, 07:45 AM
#128
Re: 20120609 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by i00
Sorry about the delay .. will have a look this weekend ... completely changed the inner workings of the spell checker ... so have been a little too busy
Will post back soon
Kris
Hrm ... not entirely sure ... but if you want to look into it...
Check the LoadFromFile function for the dictionary ....
My.Computer.FileSystem.ReadAllText(Filename) seems to load the file incorrectly ... I also tried a streamreader.readtoend... but it had the same result ... let me know if you figure out a way ... till then i will put this on the back burner...
Also you will prob need to change the save function also ... since it uses writealltext... so imagine it would save the file like that even if you get the loading working...
Kris
-
Jun 17th, 2012, 08:56 PM
#129
Re: 20120618 - i00 .Net Spell Check - Code Project prize winner!
Version 20120618 is out, with custom plug in support!
-
Jun 22nd, 2012, 12:01 AM
#130
Re: 20120622 - i00 .Net Spell Check - Code Project prize winner!
20120622 is out with plugin support for the FastColoredTextBox control!
Kris
-
Jun 23rd, 2012, 05:38 PM
#131
New Member
Re: 20120622 - i00 .Net Spell Check - Code Project prize winner!
Hi Kris,
Just a quick note from the UK to say thank you for all your hard work on this project.
I'm using i00SpellCheck in my project which allows forensic scientists to securely record their examination notes (now, with correct spelling!).
As the project is used by scientists internationally, support for Open Office dictionaries would be really cool when you get five minutes!
Once again, thank you for making this available.
Kind regards,
Fin.
-
Jun 24th, 2012, 09:23 AM
#132
Re: 20120622 - i00 .Net Spell Check - Code Project prize winner!
Plan to look into this again soon ...
Will keep you posted...
Btw version 20120625 is out ... with some speedups and test project changed to automatically load the tabs from plugins.
Kris
-
Jun 29th, 2012, 08:16 AM
#133
New Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I am using i00 Spell check in my project and it works great!!
-
Jul 14th, 2012, 04:55 AM
#134
New Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I hope you don't mind, but I'm looking into this now, and I'll likely use it for a personal project of mine. You did very well in coding this, much appreciated.
-
Jul 14th, 2012, 05:37 AM
#135
New Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Umm I'm having problems, I've not used visual basic for a long time, but I get a lot of errors.. would it be possible to get a basic guide for this? like I have no idea if I'm doing the referencing or importing right, and I get an error on the 'Me.EnableSpellCheck()'... don't suppose there's a straight forward video guide? or somethin?
-
Jul 16th, 2012, 08:32 PM
#136
New Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I got it working, though lacking the defintions, thanks anyway.
-
Jul 17th, 2012, 08:16 PM
#137
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Glad to know that you got it working ... please post what you did to get it working so others may learn if they are having the same issues...
As for a video guide this is a good idea ... I may look into doing this sometime.
Thanks
Kris
-
Jul 20th, 2012, 12:28 PM
#138
Addicted Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I am attempting to implement your program into mine. However, I am wondering is there a way where I can use this to correct spelling mistakes made in Excel? My program currently let's the User open up a Worksheet in a DataGrid and I'm wondering if I can basically do the same with your program but if when the User uploads the Excel Worksheet it will correct Spelling mistakes there. Let me know if I'm making any sense here I am very new to VB 2010. I was using VB6 previously.
If you find the information I give you useful, please rate my post and tell me why you thought it was helpful. Thanks!
If your issue has been fixed, please come back to your thread and mark it Resolved. Thanks!
-
Jul 22nd, 2012, 07:29 PM
#139
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by johndmingione
I am attempting to implement your program into mine. However, I am wondering is there a way where I can use this to correct spelling mistakes made in Excel? My program currently let's the User open up a Worksheet in a DataGrid and I'm wondering if I can basically do the same with your program but if when the User uploads the Excel Worksheet it will correct Spelling mistakes there. Let me know if I'm making any sense here I am very new to VB 2010. I was using VB6 previously.
What do you mean "in excel" ... your DataGrid that loads the excel documents does it not? the DGV can support spell checking...
In your upload process you could check each word in each cell, and change it accordingly with the spell check engine.
Is this what you meant?
Kris
-
Jul 23rd, 2012, 03:44 PM
#140
Addicted Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
What I mean by in Excel is will your Spellcheck work on a DataGrid that's on my form? I use the DataGrid to show a specific Worksheet within a Workbook and let the User edit it in the Form. If I reference your Spellcheck will it SpellCheck it?
If you find the information I give you useful, please rate my post and tell me why you thought it was helpful. Thanks!
If your issue has been fixed, please come back to your thread and mark it Resolved. Thanks!
-
Jul 24th, 2012, 08:05 PM
#141
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by johndmingione
What I mean by in Excel is will your Spellcheck work on a DataGrid that's on my form? I use the DataGrid to show a specific Worksheet within a Workbook and let the User edit it in the Form. If I reference your Spellcheck will it SpellCheck it?
Yes it does automatically spellcheck data grid views
Need to do more than reference tho, isn't hard though... check the OP
Kris
-
Aug 1st, 2012, 09:10 PM
#142
Hyperactive Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I will probably use this in my project but I do have a question:
It seems to take a long time to do the initial Spell Check on a file open. For instance, 27 lines of text with an average of about 6 or 7 words per line (many with 4 or less words) it takes about 12-15 seconds to finish. Is this normal?
-
Aug 1st, 2012, 11:22 PM
#143
Hyperactive Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I have also noticed that most of the time (seems like not always) if you close the Spell Check dialog window before it finishes checking the entire document you get the following error:
RaceOnRCWCleanup was detected
Message: An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss.
I was able to reproduce this error in your test app. I selected the RichTextBox tab, then clicked the spell check button and then immediately closed it. You may have to do this more than once to reproduce.
Thanks.
-
Aug 6th, 2012, 02:00 AM
#144
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by Maverickz
I will probably use this in my project but I do have a question:
It seems to take a long time to do the initial Spell Check on a file open. For instance, 27 lines of text with an average of about 6 or 7 words per line (many with 4 or less words) it takes about 12-15 seconds to finish. Is this normal?
It should take a few seconds ... but 12 - 15 seconds seems a little excessive ... I will look into this in a few days ... i changed the way the spell check threads work about a month ago .. will look into optimizing this
Kris
-
Aug 6th, 2012, 02:01 AM
#145
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by Maverickz
I have also noticed that most of the time (seems like not always) if you close the Spell Check dialog window before it finishes checking the entire document you get the following error:
RaceOnRCWCleanup was detected
Message: An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss.
I was able to reproduce this error in your test app. I selected the RichTextBox tab, then clicked the spell check button and then immediately closed it. You may have to do this more than once to reproduce.
Thanks.
Is this error handled? where is it breaking? - screen shot would be ideal
Thanks
Kris
-
Aug 6th, 2012, 10:38 PM
#146
Hyperactive Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by i00
Is this error handled? where is it breaking? - screen shot would be ideal
Thanks
Kris
Actually I removed the forms and recompiled the code as a DLL and the errors went away. If I get a chance I'll backup my project and reference the exe instead of the DLL and try to get you more details.
The problem of the slow spell checking times is still present though in the DLL compile though. I may try to convert the dictionary that comes with Firefox to work with your code and see if maybe the dictionary is just too large. It seems like it has a lot of Euro specific spellings that I wouldn't even use anyway, such as "colour" instead of the US "color".
-
Aug 8th, 2012, 07:18 PM
#147
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
OK... well let me know how it goes
Kris
-
Aug 13th, 2012, 12:15 AM
#148
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by Maverickz
I will probably use this in my project but I do have a question:
It seems to take a long time to do the initial Spell Check on a file open. For instance, 27 lines of text with an average of about 6 or 7 words per line (many with 4 or less words) it takes about 12-15 seconds to finish. Is this normal?
Interesting I checked the speed on my i7 2.6 GHz and it the spell check engine checks at an average of 60.42 words per second... how many words are visible in your text box (it only checks visible words)?
Even with 27 lines @ 7 words (189) words total, it should take about 3.5 seconds (after redraw time etc)...?!
Can you post the tet in your text box here?
Thanks
Kris
-
Aug 20th, 2012, 11:58 AM
#149
New Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
I am really impressed with this Spell Check and would love to implement it in a project I am working on. Great job!!
However, I am currently experiencing two issues, which may or may not be related.
The first is that we are using MDI forms for this application and the issue of drawing the correction lines is indeed as feared in your "Possible Issues" segment. It is visible over other windows. It is said that the following code can be used to implement the older "compatible" rendering.
DirectCast(TextBox.SpellCheck, SpellCheckTextBox).RenderCompatibility = True
But I am not sure where this should be located or how. I tried it both before and after EnableSpellCheck(). Before I see nothing on the text box. After, the behavior was as without the .RenderCompatibility being set. I am sure I am probably not implementing it correctly.
The other issue I have had is that the Spell Checking (minus the above stated issue) works fine with multiple MDI forms until I close one of them and try to open another, at which time I receive the error "Cannot access a disposed object". with the following references to the SpellCheck app in the exception dump:
at i00SpellCheck.SpellCheckFormExtension.ReloadSpellCheckControls(SpellCheckSettings SpellCheckSettings)
at i00SpellCheck.SpellCheckFormExtension.LoadDictionary(Object oSpellCheckSettings)
Has anyone seen something similar? Has anyone else tried using it with MDI apps?
Spell Checking is not a must have for this app, but I would love to be able to implement it with this great utility if possible.
-
Aug 21st, 2012, 09:26 AM
#150
Addicted Member
-
Aug 22nd, 2012, 11:08 PM
#151
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by stru4nak
Hi i use Macedonian dictonary i change my dictonary from mk.dic to dic.dic when i load program it doesnt show me errors like it's not load the dictonary
see pic: . Here is my dictonary opened in notepad2 and when in program click removed (some word) from dictonary or add word to dictonary my dic.dic make like this all cyrilic char is like cubic.
I use this dictonary http://openoffice.c3sl.ufpr.br/contr...ries/mk_MK.zip
Edit.
I change encoding of text from ANSI to UTF-8 now doesnt show cubic like in last picture but it doesnt load dictonary.
Originally Posted by rmoliani
Hello
I'm trying using i00SpellCheck on my project... and everything is fine.. but... i'm from brazil... and here we have a big problem: accentuation...
well.. i changed the dic.dic to my dic.dic in pt-br..
and worked fine... but some words, with accentuation stay very strange... look in pic...
Change encoding for dictonary to UTF-8 and save file, it may work for your dictonary.
Sorry I am a little confused by this post... did you sort your problem out, also if you did please describe how?
Thanks
Kris
-
Aug 22nd, 2012, 11:21 PM
#152
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by rfreedlund
I am really impressed with this Spell Check and would love to implement it in a project I am working on. Great job!!
However, I am currently experiencing two issues, which may or may not be related.
The first is that we are using MDI forms for this application and the issue of drawing the correction lines is indeed as feared in your "Possible Issues" segment. It is visible over other windows. It is said that the following code can be used to implement the older "compatible" rendering.
DirectCast(TextBox.SpellCheck, SpellCheckTextBox).RenderCompatibility = True
But I am not sure where this should be located or how. I tried it both before and after EnableSpellCheck(). Before I see nothing on the text box. After, the behavior was as without the .RenderCompatibility being set. I am sure I am probably not implementing it correctly.
The other issue I have had is that the Spell Checking (minus the above stated issue) works fine with multiple MDI forms until I close one of them and try to open another, at which time I receive the error "Cannot access a disposed object". with the following references to the SpellCheck app in the exception dump:
at i00SpellCheck.SpellCheckFormExtension.ReloadSpellCheckControls(SpellCheckSettings SpellCheckSettings)
at i00SpellCheck.SpellCheckFormExtension.LoadDictionary(Object oSpellCheckSettings)
Has anyone seen something similar? Has anyone else tried using it with MDI apps?
Spell Checking is not a must have for this app, but I would love to be able to implement it with this great utility if possible.
Since your application is a MDI application, you probably want all controls to use render compatibility. To do this the best method would probably be to do this:
vb Code:
AddHandler SpellCheckControlExtension.SpellCheckControlAdded, AddressOf SpellCheckControlAdded Me.EnableSpellCheck '.... Private Sub SpellCheckControlAdded(ByVal sender As Object, ByVal e As SpellCheckControlAddedRemovedEventArgs) Dim SpellCheckTextBox = TryCast(e.Control.SpellCheck, SpellCheckTextBox) If SpellCheckTextBox IsNot Nothing Then SpellCheckTextBox.RenderCompatibility = True End If End Sub
Let me know if this works
Thanks
Kris
EDIT:
Also I just checked placing DirectCast(TextBox1.SpellCheck, SpellCheckTextBox).RenderCompatibility = True directly after .EnableSpellCheck() ...
Worked fine for me ... if you are still stuck maybe you could paste your code?
Thanks
Kris
Last edited by i00; Aug 22nd, 2012 at 11:27 PM.
-
Aug 23rd, 2012, 02:29 AM
#153
Addicted Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
For latin language like brazilian who have special characters worked when you change encoding to UTF-8 but for cyrilic language like Macedonian, Russian, Serbian and etc doesn't work, it not show spell correction. So this spellchecker work only for English language.
Last edited by stru4nak; Aug 23rd, 2012 at 08:47 AM.
MACEDONIA 4EVER
-
Aug 23rd, 2012, 09:07 AM
#154
New Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by i00
Since your application is a MDI application, you probably want all controls to use render compatibility. To do this the best method would probably be to do this:
vb Code:
AddHandler SpellCheckControlExtension.SpellCheckControlAdded, AddressOf SpellCheckControlAdded
Me.EnableSpellCheck
'....
Private Sub SpellCheckControlAdded(ByVal sender As Object, ByVal e As SpellCheckControlAddedRemovedEventArgs)
Dim SpellCheckTextBox = TryCast(e.Control.SpellCheck, SpellCheckTextBox)
If SpellCheckTextBox IsNot Nothing Then
SpellCheckTextBox.RenderCompatibility = True
End If
End Sub
Let me know if this works
Thanks
Kris
EDIT:
Also I just checked placing DirectCast(TextBox1.SpellCheck, SpellCheckTextBox).RenderCompatibility = True directly after .EnableSpellCheck() ...
Worked fine for me ... if you are still stuck maybe you could paste your code?
Thanks
Kris
Kris,
Thanks for replying. I modified the code as follows to reference only the specific text box, instead of the entire form:
txtProblem.EnableSpellCheck()
DirectCast(txtProblem.SpellCheck, SpellCheckTextBox).RenderCompatibility = True
However, I still get the overlay effect:
Spell Checked Text Box:
Another form over top of that text box:
Also, is there some cleanup I should be doing after my form is closed? When I open up another MDI form after closing the last one, I still get the "Cannot access a disposed object." error.
System.ObjectDisposedException was unhandled
Message=Cannot access a disposed object.
Object name: 'RichTextBox'.
Source=System.Windows.Forms
ObjectName=RichTextBox
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at i00SpellCheck.SpellCheckFormExtension.ReloadSpellCheckControls(SpellCheckSettings SpellCheckSettings)
at i00SpellCheck.SpellCheckFormExtension.LoadDictionary(Object oSpellCheckSettings)
Thanks for any help you can provide. If we can't use the SpellCheck on this MDI app, we think we can still utilize it on some standard Windows form app.
-
Aug 23rd, 2012, 11:10 AM
#155
Hyperactive Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by i00
Interesting I checked the speed on my i7 2.6 GHz and it the spell check engine checks at an average of 60.42 words per second... how many words are visible in your text box (it only checks visible words)?
Even with 27 lines @ 7 words (189) words total, it should take about 3.5 seconds (after redraw time etc)...?!
Can you post the tet in your text box here?
Thanks
Kris
So I reran my tests using the contents of post #37 in THIS thread:
http://www.vbforums.com/showthread.p...=1#post4089783
Using your dictionary took 13 seconds, using the smaller Firefox dictionary took 6 seconds. I am running on significantly older equipment than you are so I am sure that is part of it.
When you perform the spell check do you take each word, and the compare it to every word in the entire dictionary?
-
Aug 23rd, 2012, 06:11 PM
#156
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by stru4nak
For latin language like brazilian who have special characters worked when you change encoding to UTF-8 but for cyrilic language like Macedonian, Russian, Serbian and etc doesn't work, it not show spell correction. So this spellchecker work only for English language.
Probably the case, sorry but I am not familiar on how to load / save files that contain cyrilic characters from a file.
The functions for loading / saving the dictionaries are in i00SpellCheck\Spell Check\Engine\Dictionary.vb, LoadFromFile() and Save().
The offending lines (I think) are:
Dim fileData = My.Computer.FileSystem.ReadAllText(Filename)
and
My.Computer.FileSystem.WriteAllText(...
If anyone knows how to do this, please let me know
Thanks
Kris
-
Aug 23rd, 2012, 06:50 PM
#157
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by rfreedlund
Kris,
Thanks for replying. I modified the code as follows to reference only the specific text box, instead of the entire form:
txtProblem.EnableSpellCheck()
DirectCast(txtProblem.SpellCheck, SpellCheckTextBox).RenderCompatibility = True
However, I still get the overlay effect:
Spell Checked Text Box:
Another form over top of that text box:
Also, is there some cleanup I should be doing after my form is closed? When I open up another MDI form after closing the last one, I still get the "Cannot access a disposed object." error.
System.ObjectDisposedException was unhandled
Message=Cannot access a disposed object.
Object name: 'RichTextBox'.
Source=System.Windows.Forms
ObjectName=RichTextBox
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at i00SpellCheck.SpellCheckFormExtension.ReloadSpellCheckControls(SpellCheckSettings SpellCheckSettings)
at i00SpellCheck.SpellCheckFormExtension.LoadDictionary(Object oSpellCheckSettings)
Thanks for any help you can provide. If we can't use the SpellCheck on this MDI app, we think we can still utilize it on some standard Windows form app.
Sorry about not replying to this before, forgot about it ...
OK ... I found out what the error was ... I had some code in there that never gets called ...
I have fixed this bug and it will be in the next update ... but until then you can replace (or edit - change is in Maroon) the SpellCheck() function in i00SpellCheck\Spell Check\Engine\Extension.vb
Code:
<System.Runtime.CompilerServices.Extension()> _
Public Function SpellCheck(ByVal sender As Control, Optional ByVal AutoCreate As Boolean = True, Optional ByVal SpellCheckSettings As SpellCheckSettings = Nothing) As SpellCheckControlBase
If SpellCheckControls.ContainsKey(sender) Then
'exists
Else
If AutoCreate Then
''create SpellCheckControlBase object and send it back...
Static plugins As List(Of SpellCheckControlBase) = PluginManager(Of SpellCheckControlBase).GetPlugins
Dim AcceptedClass = (From xItem In plugins Where xItem.ControlType.IsAssignableFrom(sender.GetType)).FirstOrDefault
If AcceptedClass IsNot Nothing Then
Dim SpellCheckControlAddingEventArgs As New SpellCheckControlAddingEventArgs
RaiseEvent SpellCheckControlAdding(Nothing, SpellCheckControlAddingEventArgs)
If SpellCheckControlAddingEventArgs.Cancel = True Then
Return Nothing
End If
'create a new instance of the plugin class
Dim o = DirectCast(System.Activator.CreateInstance(AcceptedClass.GetType), SpellCheckControlBase) 'TryCast(AcceptedClass.CreateObject, SpellCheckControlBase)
If o IsNot Nothing Then
SpellCheckControls.Add(sender, o)
AddHandler sender.Disposed, AddressOf Control_Disposed
o.mc_Control = sender
o.DoLoad()
RaiseEvent SpellCheckControlAdded(Nothing, New SpellCheckControlAddedRemovedEventArgs With {.Control = sender})
Else
Return Nothing
End If
Else
'no plugins for this control type
Return Nothing
End If
Else
'we don't want to automatically this control to check spelling, and it is not enabled already so return nothing
Return Nothing
End If
End If
If SpellCheckSettings IsNot Nothing Then
SpellCheckControls(sender).Settings = SpellCheckSettings
End If
Return SpellCheckControls(sender)
End Function
Also no cleanup is needed
Kris
Last edited by i00; Aug 23rd, 2012 at 07:26 PM.
-
Aug 23rd, 2012, 06:57 PM
#158
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by Maverickz
So I reran my tests using the contents of post #37 in THIS thread:
http://www.vbforums.com/showthread.p...=1#post4089783
Using your dictionary took 13 seconds, using the smaller Firefox dictionary took 6 seconds. I am running on significantly older equipment than you are so I am sure that is part of it.
When you perform the spell check do you take each word, and the compare it to every word in the entire dictionary?
There are two types of spell checking (Both functions are in i00SpellCheck\Spell Check\Engine\SpellCheck.vb)...
You are talking about the correctness of a word.
This is done in SpellCheckWord()...
This does check if the word is in the dictionary of 150K words, with a few exceptions ... eg a word that is all caps is ignored, numbers etc.
For the actual suggestions (this is done when right clicking on an incorrect word for eg)...
This is done in SpellCheckSuggestions()
It basically takes the whole dictionary and eliminates words based on certain rules, to make a smaller dictionary.
Each word, in the smaller dictionary, is then given a "closeness" rating based on other rules, this is sorted and returned.
Kris
Last edited by i00; Aug 23rd, 2012 at 07:09 PM.
-
Aug 23rd, 2012, 08:01 PM
#159
Hyperactive Member
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by i00
There are two types of spell checking (Both functions are in i00SpellCheck\Spell Check\Engine\SpellCheck.vb)...
You are talking about the correctness of a word.
This is done in SpellCheckWord()...
This does check if the word is in the dictionary of 150K words, with a few exceptions ... eg a word that is all caps is ignored, numbers etc.
Kris
I only briefly looked at the code, and it appears that you load the whole dictionary into an array. Could you build another array (letter, start position, end position) at the same time to indicate where each starting letter in main array begins and ends and then use those values in the for loop to only search words that begin with the same letter?
For instance the first entry in the second array might be ("a", 1, 5790). So any words you are checking that start with the letter A would then only search the first 5790 words instead of all 150k before realizing that it was misspelled.
This should cut processing time way down.
Last edited by Maverickz; Aug 23rd, 2012 at 08:05 PM.
-
Aug 23rd, 2012, 10:28 PM
#160
Re: 20120625 - i00 .Net Spell Check - Code Project prize winner!
Originally Posted by Maverickz
I only briefly looked at the code, and it appears that you load the whole dictionary into an array. Could you build another array (letter, start position, end position) at the same time to indicate where each starting letter in main array begins and ends and then use those values in the for loop to only search words that begin with the same letter?
For instance the first entry in the second array might be ("a", 1, 5790). So any words you are checking that start with the letter A would then only search the first 5790 words instead of all 150k before realizing that it was misspelled.
This should cut processing time way down.
Indexing like this is a good idea... I will put this in my todo list for the next update... will probably be about a week away... the only issue with this is that the dictionary would have to be kept in order ... but no biggie
Thanks for the suggestion btw
Kris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|