blob: 85607b58e72c15431247c1a5945249ada338217a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#--------------------------------------------------------------------
# Copyright (c) 1999-2004, International Business Machines
# Corporation and others. All Rights Reserved.
#--------------------------------------------------------------------
# Only intended for internal use
:: fullwidth-halfwidth;
。 > '.';
$terminalPunct = [\.\,\:\;\?\!.,:?!。、;[:Pe:][:Pf:]];
$initialPunct = [:Ps:][:Pi:];
# add space between any Han or terminal punctuation and letters, and
# between letters and Han or initial punct
[[:Ideographic:] $terminalPunct] {} [:Letter:] > ' ' ;
[:Letter:] [:Mark:]* {} [[:Ideographic:] $initialPunct] > ' ' ;
# remove spacing between ideographs and other letters
< [:Ideographic:] { ' ' } [:Letter:] ;
< [:Letter:] [:Mark:]* { ' ' } [:Ideographic:] ;
|