[Python-Dev] Re: Where to put wrap_text()?

Greg Ward gward@python.net
Tue, 4 Jun 2002 21:14:02 -0400


On 04 June 2002, Fran?ois Pinard said:
> Hi, people.
> 
> For this incoming text wrapper facility, there is a feature that appears
> really essential to me, and many others: the protection of full stops[1].

If you mean reformatting this:

"""
This is a sentence ending.
If we convert each newline to a single space, there won't
be enough space after that period.
"""

to this:

"""
This is a sentence ending.  If we convert each newline to a single
space, there won't be enough space after that period.
"""

then my wrapping algorithm handles it.  However, it's currently limited
to English, because it relies on string.lowercase to detect sentence
ending periods -- this needs to be fixed, but I was going to post the
code and let someone who understands locales tell me what to do.  ;-)

        Greg
-- 
Greg Ward - programmer-at-big                           gward@python.net
http://starship.python.net/~gward/
"... but in the town it was well known that when they got home their fat and
psychopathic wives would thrash them to within inches of their lives ..."