Go Back   TX Text Control Community > TX Text Control Discussion and Support Forums > TX Text Control RapidSpell .NET

TX Text Control RapidSpell .NET Please use this forum for TX Text Control RapidSpell .NET support only. If you need support for a different product, please use the appropriate forum.

Reply
 
Thread Tools Display Modes
  #1  
Old October 13, 2009
vtspn vtspn is offline
Registered User
 
Join Date: Sep 2009
Posts: 3
Question Ignore a badword from code

Hi there,

I'm looking for a way to ignore badwords (with REASON_DUPLICATE) from code in a document using TXTextControl and RapidSpell.

We don't want to disable the WarnDuplicates option, but after opening the document we want to ignore some specific duplicate words (or actually single characters like 'R A P P O R T') in the document. In this case the second 'P' is a badword (REASON_DUPLICATE). Selecting the specific badwords is not the problem, but ignoring the badword fails. Unfortunately I wasn't able to find anything in the documentation.

I basically tried 2 different methods:
rapidSpellAsYouType.RapidSpellChecker.IgnoreList.A dd(badword);
-> This results (later) in a crash in TXTextControl

rapidSpellAsYouType.IgnoreOnce(badword, ayttb);
I'm not able to pass the second parameter, because I don't know how to get a suitable IAYTTextBox object and the TXTextControl as not castable to IAYTTextBox.

How should I do this? Can anybody give me a hint on this?

Thanks in advance,
Juda

Last edited by vtspn; October 14, 2009 at 07:56:28.
Reply With Quote
  #2  
Old October 14, 2009
vtspn vtspn is offline
Registered User
 
Join Date: Sep 2009
Posts: 3
Re: Ignore a badword from code

I'm a step further now, but still have a problem:

As far as I can see now the IgnoreList is only used for misspelled words (and not for duplicates). The IgnoreList is updated by the IgnoreAll method, and the ArrayList contains string values (and no other object types like BadWord).

The IgnoreOnce method seems to fit better. I found the TXTextControlAdapter which is a TXTextControl wrapper for RapidSpell and now I'm able to Ignore duplicate words from code .

After the IgnoreOnce method is called, I can see the word is ignored (because the underline is gone), but if the RapidSpellDialog is used again, it prompts again for the ignored words. If now the duplicate word is ignored (again) in the dialog, it stays ignored well.

So the remaining problem is:
If a word is ignored using the IgnoreOnce method, this is not 'remembered' by the RapidSpellDialog. What can be the reason for this?

Any help is appreciated!

Last edited by vtspn; October 14, 2009 at 10:42:28.
Reply With Quote
  #3  
Old October 16, 2009
Fabian Zenker's Avatar
Fabian Zenker Fabian Zenker is offline
TX Support Engineer
TX Text Control
 
Join Date: Jun 2008
Posts: 72
Re: Ignore a badword from code

Hi Juda!

The simplest way to achieve the goal of having RapidSpellDialog ignore single letter duplicate words is to add this class to the project

Code:
class CRapidSpellChecker : Keyoti.RapidSpell.RapidSpellChecker

{

public override Keyoti.RapidSpell.BadWord NextBadWord()

{

Keyoti.RapidSpell.BadWord b = base.NextBadWord();

if (b != null && b.Reason == Keyoti.RapidSpell.BadWord.REASON_DUPLICATE && b.Word.Length == 1)

return NextBadWord();

else return b;

}

}
and then use it by doing this

Code:
rapidSpellDialog1.CheckerEngine = new CRapidSpellChecker();
Regards,
Fabian
Reply With Quote
  #4  
Old October 21, 2009
vtspn vtspn is offline
Registered User
 
Join Date: Sep 2009
Posts: 3
Re: Ignore a badword from code

Hi Fabian,
Thanx a lot! This is a great solution for custom spell checker rules, it also works fine for some other custom rules in our environment...

Can I also use this custom class with the RapidSpellAsYouType? Because I couldn't find a way to set a custom spell checker engine for the RapidSpellAsYouType. The 'CheckerEngine' property is not available. Now we have to implement the custom spell checker rules in 2 different ways.

So is it possible to reuse the CRapidSpellChecker class with RapidSpellAsYouType (or is this only possible with the RapidSpellDialog)?



Thanks in advance
Reply With Quote
  #5  
Old October 21, 2009
Fabian Zenker's Avatar
Fabian Zenker Fabian Zenker is offline
TX Support Engineer
TX Text Control
 
Join Date: Jun 2008
Posts: 72
Re: Ignore a badword from code

Hi!
Yes you can set the engine in RapidSpellAsYouType, by setting it's "RapidSpellChecker" property (the name is different because the required type is different to RapidSpellDialog but it doesn't really matter). This will work for most rules, the only thing it won't work with is duplicate word rules - this is because the RapidSpellAsYouType has to process duplicate words by itself, rather than using RapidSpellChecker.

Regards,
Fabian
Reply With Quote
Reply

Bookmarks

Tags
rapidspell ignore badword

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To Retreive RTF code Anujith TX Text Control .NET 4 May 28, 2009 03:32:54
Selecting misspelled words from code koelvin TX Text Control RapidSpell .NET 2 May 18, 2009 09:09:15
CUT,Copy,Paste code for editing object paldebu78 TX Text Control ActiveX 1 October 25, 2005 13:27:37
Bullet list: bullet charater code needed moroandrea TX Text Control .NET 0 July 5, 2004 09:22:15


All times are GMT +1. The time now is 06:20:27.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 1991 - 2010 The Imaging Source Europe GmbH