943,582 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 433
  • VB.NET RSS
Aug 6th, 2009
0

Start of New Senetence

Expand Post »
Hi All
I need to capitalize the first word of each new sentence as user types. How will i come to know about the start of new sentences?
do i need to use regular expression for this?
Similar Threads
Reputation Points: 48
Solved Threads: 111
Practically a Master Poster
Pgmer is online now Online
667 posts
since Apr 2008
Aug 6th, 2009
0

Re: Start of New Senetence

I think that would be one way. You would have to assume that the only periods in your input are for sentence endings, not for abbreviations (st. mt. ms.) or numbers (3.14) or email addresses (john.smith@gmail.com).

Barring those annoyances, you could check for the first non-whitespace character after a period and make that a capital.
Reputation Points: 9
Solved Threads: 2
Newbie Poster
TeejMonster is offline Offline
19 posts
since Jul 2009
Aug 7th, 2009
0

Re: Start of New Senetence

This requirement seems a bit expensive as far as processing goes. What kind of application are you creating that needs this. Maybe there is another way to handle it.
Reputation Points: 10
Solved Threads: 2
Light Poster
textbox is offline Offline
38 posts
since Jul 2009
Aug 8th, 2009
0

Re: Start of New Senetence

Click to Expand / Collapse  Quote originally posted by textbox ...
This requirement seems a bit expensive as far as processing goes. What kind of application are you creating that needs this. Maybe there is another way to handle it.
Its kind of word processor application.
any idea to achive this ?
Reputation Points: 48
Solved Threads: 111
Practically a Master Poster
Pgmer is online now Online
667 posts
since Apr 2008
Aug 8th, 2009
0

Re: Start of New Senetence

Well obviously a period(.) indicates the end of a line. You can try it this way:

1) Check for period at the end of a word. So go word by word and check if a word ends with a period, for example "I am a VB.NET programmer." In this case we found "programmer." A word here means a series of characters without a space in between.
2) Now check if the character after the period[.] is a space. If it's a space and followed by an uppercase character then it's safe to assume the end of the line in most cases where the typing is standard.

I'm not sure if you can do this using regular expressions ..
Last edited by JadeSimon; Aug 8th, 2009 at 7:19 pm.
Reputation Points: 20
Solved Threads: 5
Newbie Poster
JadeSimon is offline Offline
12 posts
since Aug 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: label multiline
Next Thread in VB.NET Forum Timeline: datagridview to excel





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC