Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

TxTextControl20 and Sentence Capitalisation - RapidSpell Desktop .NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
andyrennison
#1 Posted : Wednesday, March 12, 2014 1:56:27 PM
Rank: Member

Groups: Registered

Joined: 3/12/2014
Posts: 3
Hi Jim

I am using rapidspell desktop 5.1.1 (installed from file RapidSpellDesktop-NET-5.1.1-UD-Setup.msi) with txtextcontrol20. I can only find the 3rd party dll for 5.1.0?? (file version 5.1.13.82)

The problem I am facing is that the option IgnoreIncorrectSentenceCapitalisation is not showing in the component.

I am trying to set up so that the first letter of a sentence is auto capitalised.

Is there something I am doing wrong (I hope so!)

Thanks

Andy
Jim
#2 Posted : Wednesday, March 12, 2014 4:30:30 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi Andy, sorry you aren't doing anything wrong. With TX we have limited context, we're just asked to spell check a word, so we don't know where in the sentence that word is, hence, can't judge it's capitalisation.

Best
Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


andyrennison
#3 Posted : Wednesday, March 12, 2014 5:01:24 PM
Rank: Member

Groups: Registered

Joined: 3/12/2014
Posts: 3
Thanks Jim. Have you come across any neat solutions to capitalising the first character of a sentence in TxTextControl ?

I'd rather not re-invent the wheel!

Thanks for the fast reply :)
Jim
#4 Posted : Wednesday, March 12, 2014 6:55:47 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
I haven't sorry. In theory you could grab the body text and spell check it using the RapidSpellChecker.Check(body) method - then iterate NextBadWord to find capitalization errors.

But even then you have to map from the string you passed to Check back to the character indices in the actual document, to make the change.

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


andyrennison
#5 Posted : Wednesday, March 12, 2014 10:13:44 PM
Rank: Member

Groups: Registered

Joined: 3/12/2014
Posts: 3
Thanks Jim

Got it sorted. On the keypress I look at the preceding 2 characters in the text. if they are ". " then I uppercase the key, does all I need.

Thanks for a great component :)

Andy
Jim
#6 Posted : Wednesday, March 12, 2014 10:42:56 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
That's neat - just remember to account for things like "e.g." where you don't want upper case next. Oh and don't forget ! ? as sentence enders either.

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.