ab056703bd
X-SVN-Rev: 13614
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
#
|
|
# Copyright (C) 2002-2003, International Business Machines Corporation and others.
|
|
# All Rights Reserved.
|
|
#
|
|
# file: char.txt
|
|
#
|
|
# ICU Character Break Rules, also known as Grapheme Cluster Boundaries
|
|
# See Unicode Standard Annex #29.
|
|
# These rules are based on TR29 Version 4.0.0
|
|
#
|
|
|
|
#
|
|
# Character Class Definitions.
|
|
# The names are those from TR29.
|
|
#
|
|
$CR = \r;
|
|
$LF = \n;
|
|
$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:]];
|
|
|
|
$Extend = [[:Grapheme_Extend = TRUE:]];
|
|
|
|
#
|
|
# Korean Syllable Definitions
|
|
#
|
|
$L = [:Hangul_Syllable_Type = L:];
|
|
$V = [:Hangul_Syllable_Type = V:];
|
|
$T = [:Hangul_Syllable_Type = T:];
|
|
|
|
$LV = [:Hangul_Syllable_Type = LV:];
|
|
$LVT = [:Hangul_Syllable_Type = LVT:];
|
|
|
|
$HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+;
|
|
|
|
## -------------------------------------------------
|
|
|
|
!!forward;
|
|
|
|
$CR $LF;
|
|
([^$Control] | $HangulSyllable) $Extend*;
|
|
|
|
## -------------------------------------------------
|
|
|
|
!!reverse;
|
|
|
|
$BackHangulSyllable = $L+ | ($T* ($V+$LV? | $LV | $LVT) $L*) | $T+;
|
|
$BackOneCluster = ($LF $CR) | ($Extend* ([^$Control] | $BackHangulSyllable));
|
|
$BackOneCluster;
|
|
|
|
## -------------------------------------------------
|
|
|
|
!!safe_reverse;
|
|
|
|
$BackOneCluster; |