Start of New Senetence

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Start of New Senetence

 
0
  #1
Aug 6th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 18
Reputation: TeejMonster is an unknown quantity at this point 
Solved Threads: 1
TeejMonster's Avatar
TeejMonster TeejMonster is offline Offline
Newbie Poster

Re: Start of New Senetence

 
0
  #2
Aug 6th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 38
Reputation: textbox is an unknown quantity at this point 
Solved Threads: 1
textbox textbox is offline Offline
Light Poster

Re: Start of New Senetence

 
0
  #3
Aug 7th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Re: Start of New Senetence

 
0
  #4
Aug 8th, 2009
Originally Posted by textbox View Post
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 ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 12
Reputation: JadeSimon is an unknown quantity at this point 
Solved Threads: 4
JadeSimon JadeSimon is offline Offline
Newbie Poster

Re: Start of New Senetence

 
0
  #5
Aug 8th, 2009
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC