Attached is a library I created that uses a Google API to retrieve spelling suggestions for text. The attachment is a solution that will compile into a dll.
Here is an example:
And this would be the output:Code:Imports System.Globalization Imports System.SpellChecking Public Sub SpellCheck() '//create the spell checking class Using checker = New Checker(CultureInfo.CurrentCulture) '//create the request Dim request = New Request("The folloing text is a tst.") request.Multilined = False '//you can pass plain text to the check method if desired Dim result = checker.Check(request) '//check if the spell check errored If result.Errored Then Console.WriteLine("Spell check errored") Else If result.HasCorrections Then '//loop through all the corrections For Each c As Correction In result.Corrections '//write out the word that the suggestions are for Console.WriteLine("{0}:", c.Word) If c.HasSuggestions Then For Each s As Suggestion In c.Suggestions '//write out each suggestion for the word Console.WriteLine("{0}{1}", ControlChars.Tab, s.Value) Next Else Console.WriteLine("{0}No suggestions", ControlChars.Tab) End If Next Else Console.WriteLine("No corrections") End If End If End Using End Sub
I'll leave it up to you to create your own spell checking user interface. As long as you or the user have an internet connection you can spell check.Code:folloing: fooling filling following falling felling tst: test tat ST St st
Also note that, exposed in the Checker class, is a CheckAsync method so that you can asynchronously spell check. I have also completely documented every member so that nothing should be unclear.


Reply With Quote
