I am currently in the process of writing my own spell checking library, pretty much just because it’s a good learning experince and because I can. Anyway it seems to work pretty good so far, it is quite simple though uses the following steps to accomplish spell checking.
- Check current word in dictionary/list of words.
- If no exact match is found(case insensitive or not) then it starts matching.
- Matching the words involves going though each word in list and comparing the strings.
- Strings are compared by a CompateStrings method that rates string2 against string1 on a 100 point scale.
- Words that come withing a certain point limit of string1 will be added to a list of possible suggestions and returned.
This all seems to work pretty good, quite quickly for how it does it, but then I have not done any 10,000+ word dictionary / list searches yet, but I will soon and update with some speed results.
But back to the CompareStrings method, this method gives both strings 100 points, and rates string2 against string1 it first gets how many points each char are worth, afterwards compares each char in string1 to string2 a certain points per char are lost for each character that does not match, afterwards it checkers for the lengths and then multiplies the points per char to the difference in chars and returns the score that string2 got. Pretty simple, but pretty effective so far.
Anyways I will post a downlod to the current version quite soon, I have still got to implement a couple of things, maybe also make suggestion searches a little better.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.