Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92406

Re: Python NBSP DWIM

From random832@fastmail.us
Subject Re: Python NBSP DWIM
Date 2015-06-10 11:57 -0400
References <20150610082812.2ce887c3@bigbox.christie.dr><CANc-5UxaGMbY4BCDjuui4XXq=g2NKYXnYJAzgp9aNzDjOWZjyg@mail.gmail.com> <201506101503.t5AF3w8J004902@fido.openend.se>
Newsgroups comp.lang.python
Message-ID <mailman.348.1433951861.13271.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jun 10, 2015, at 11:03, Laura Creighton wrote:
> In these unicode days, this thinking may need to be revisited.  There
> are many languages where whitespace does not separate words -- either
> words aren't separated, or in Vietnamese, spaces separate syllables,
> so entire words have spaces in them.

Text wrapping for CJK scripts is another topic that might be worth
addressing in textwrap - words aren't space-separated, but there are
still rules about where you can place a line break. Generally these are
centered around preventing punctuation marks from being orphaned rather
than any attempt to algorithmically find word boundaries.

For the process called "Oikomi", while messing with kerning is not
strictly possible for monospaced text, it might be worthwhile in general
to have "preferred" and "maximum" line widths as parameters for
textwrap.

http://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python NBSP DWIM random832@fastmail.us - 2015-06-10 11:57 -0400

csiph-web