diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2013-11-27 16:02:55 +0100 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2013-11-27 16:15:17 +0100 |
commit | 481a9a3d94cbfd121550eec1fb03afcbfdf7694f (patch) | |
tree | 527ed6a1a7349ede18ffc24a65fcfd792f684bf4 /crawl-ref/source/util/txc | |
parent | 81894dfcdabe2be703ee3afd73f429d7a3ddc6b1 (diff) | |
download | crawl-ref-481a9a3d94cbfd121550eec1fb03afcbfdf7694f.tar.gz crawl-ref-481a9a3d94cbfd121550eec1fb03afcbfdf7694f.zip |
[txc] Improve the wrapping for languages without spaces.
Punctuation is less likely to end up at the beginning of a line (but it still
can happen). Tags are also less likely to be broken.
Diffstat (limited to 'crawl-ref/source/util/txc')
-rwxr-xr-x | crawl-ref/source/util/txc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/util/txc b/crawl-ref/source/util/txc index 4dd5c3795c..b0e5870608 100755 --- a/crawl-ref/source/util/txc +++ b/crawl-ref/source/util/txc @@ -234,8 +234,7 @@ class FullWidthTextWrapper(TextWrapper): if 'no_space' in kwargs: kwargs.pop('no_space') # Those languages don't use spaces. Break lines on punctuation. - self.wordsep_simple_re = re.compile(r'(\s+|[^\s\w]*\w+[^0-9\W]' - u'[、。,])') + self.wordsep_simple_re = re.compile(u'([\s、。,!:—;)]+)') TextWrapper.__init__(self, **kwargs) def _split(self, text): |