Knowledgebase Home Page  >  RapidSpell Desktop .NET  >  Behavior Customization
Search the Knowledge Base
(VB.NET) How to customize the core spell checker behavior with RapidSpellAsYouType
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=94&catId=62

Options

Print this page
Email this to a friend
Customizing the spell checker behavior in RapidSpellAsYouType or RapidSpellDialog is fairly trivial.  By subclassing the RapidSpellChecker class and passing an instance of the subclass to the control, the underlying behaviour can be customised by overriding the various lookup methods.
 
Consider a simple example where we want to mark all words that don't begin with the letter 't' as incorrect;
 
1. Add RapidSpellAsYouType control to a form, add a AYTRichTextBox control to a form
 
 
2. In the Form Load do this;

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.RapidSpellAsYouType1.RapidSpellChecker = New CustomCheckerEngine.CustomRapidSpellChecker

End Sub

 

3. Add this class to your project

Public Class CustomRapidSpellChecker

    Inherits Keyoti.RapidSpell.RapidSpellChecker

    Protected Overrides Function LookUpMainDictionary(ByVal word As String) As Boolean

        If word.Length = 0 Then Return True

        If word.ToLower().Chars(0) = "t" Then

            Return True

        Else

            Return False

        End If

    End Function

End Class

 

This can also be extended by overriding other methods such as LookUpUserDictionary and FindSuggestions.  Please see the API docs for further details.

Full project can be downloaded here http://keyoti.com/downloads/KBAttachments/CustomCheckerEngine.zip 

 


Related Questions:

Attachments:

No attachments were found.