<br>I can't tell if this will work because I do not have access to Python on Windows or Gnu-Linux<br><br>This is a guess after I searched The Google for hints or suggestions and found nothing specific. My reasoning is that because Python >
2.3 already has Universal newline support I need to look for 2 consecutive instances of that, *not* specifically '\n\n'.<br><br><code>
<br>import re<br><br>def clean(msg):<br> sentences = re.split(r'((?:\.|\?|!|\n{2})\s*)', msg) #this is the only line I changed.<br><br> capitalized = [s[0:1].capitalize() + s[1:] for s in sentences]<br><br>
capitalized_2 = ''.join(capitalized)<br><br> break_msg = re.split('(\s)', capitalized_2)<br> i_noun = [re.sub('^i$', 'I', i) for i in break_msg]<br><br> i_ve_noun = [re.sub('i\'ve', 'I\'ve',i) for i in i_noun]
<br><br> I = ''.join(i_ve_noun)<br> return I<br></code><br><br>Cheers<br><br>-Isaac<br><br><div><span class="gmail_quote">On 3/5/07, <b class="gmail_sendername">Stephen McInerney</b> <<a href="mailto:spmcinerney@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
spmcinerney@hotmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Can you rewrite it with Universal Newline Support ?<br><br>It is ugly to have hard \n\n or \n\r
<br><br>Thanks,<br>Stephen<br><br><br>>From: "wesley chun" <<a href="mailto:wescpy@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">wescpy@gmail.com</a>><br>>To: Isaac <
<a href="mailto:hyperneato@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hyperneato@gmail.com</a>>
<br>>CC: Python <<a href="mailto:baypiggies@python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">baypiggies@python.org</a>><br>>Subject: Re: [Baypiggies] Python course for non-programmer
<br>>Date: Mon, 5 Mar 2007 11:49:53 -0800<br>><br>> > is not splitting msg correctly because windows and unix have different
<br>> > newline characters.(?)<br>><br>>hence Universal Newline Support back in 2.3:<br>><br>><a href="http://www.python.org/dev/peps/pep-0278/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.python.org/dev/peps/pep-0278/</a><br>><br>>-wesley
<br>>_______________________________________________<br>>Baypiggies mailing list<br>><a href="mailto:Baypiggies@python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Baypiggies@python.org
</a><br>>To change your subscription options or unsubscribe:<br>
><a href="http://mail.python.org/mailman/listinfo/baypiggies" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.python.org/mailman/listinfo/baypiggies</a><br><br>_________________________________________________________________
<br>Play Flexicon: the crossword game that feeds your brain. PLAY now for FREE.
<br> <a href="http://zone.msn.com/en/flexicon/default.htm?icid=flexicon_hmtagline" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://zone.msn.com/en/flexicon/default.htm?icid=flexicon_hmtagline
</a><br><br></blockquote></div><br>