Archive for the 'C#' Category

07
Jul

SpellChecker.

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.

  1. Check current word in dictionary/list of words.
  2. If no exact match is found(case insensitive or not) then it starts matching.
  3. Matching the words involves going though each word in list and comparing the strings.
  4. Strings are compared by a CompateStrings method that rates string2 against string1 on a 100 point scale.
  5. 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.

05
Jul

NotificationBar - Free .NET control.

So I got a free control here for you. It is a pretty simple control, completly in C#. It is a notification/information bar, like that found in IE when you try to download something.

NotificationBar Example.Screenshot of notification bar and demo under linux.

Features of this control include.

  • LGPL License.
  • Easy to use.
  • Works on Mono.
  • Automatically resizes to fit text.
  • Can play system sound when shown.
  • Can flash control any number of times for any number of milliseconds.
  • Can show a ContextMenuStrip when clicked.
  • Useful for when you don’t want to show a MessageBox but want to give the user some info.
  • Uses .NET 2.0.
  • Written in C#.

It comes with a demo project and you can download it here - NotificationBar.zip (343)