文本文件  |  69行  |  1.48 KB

#
#   Copyright (C) 2002-2009, International Business Machines Corporation and others.
#       All Rights Reserved.
#
#   file:  char_th.txt 
#
#   ICU Character Break Rules, also known as Grapheme Cluster Boundaries
#      See Unicode Standard Annex #29.
#      These rules are based on TR29 Revision 13, for Unicode Version 5.1
#

#
#  Character Class Definitions.
#
$CR          = [\p{Grapheme_Cluster_Break = CR}];
$LF          = [\p{Grapheme_Cluster_Break = LF}];
$Control     = [\p{Grapheme_Cluster_Break = Control}];
$Extend      = [\p{Grapheme_Cluster_Break = Extend} - [\u0E30 \u0E32 \u0E45 \u0EB0 \u0EB2]];
$SpacingMark = [\p{Grapheme_Cluster_Break = SpacingMark}];

#
# Korean Syllable Definitions
#
$L       = [\p{Grapheme_Cluster_Break = L}];
$V       = [\p{Grapheme_Cluster_Break = V}];
$T       = [\p{Grapheme_Cluster_Break = T}];

$LV      = [\p{Grapheme_Cluster_Break = LV}];
$LVT     = [\p{Grapheme_Cluster_Break = LVT}];


## -------------------------------------------------
!!chain;

!!forward;

$CR $LF;

$L ($L | $V | $LV | $LVT);
($LV | $V) ($V | $T);
($LVT | $T) $T;

[^$Control $CR $LF] $Extend;

[^$Control $CR $LF] $SpacingMark;


## -------------------------------------------------

!!reverse;
$LF $CR;
($L | $V | $LV | $LVT) $L;
($V | $T) ($LV | $V);
$T ($LVT | $T);

$Extend      [^$Control $CR $LF];
$SpacingMark [^$Control $CR $LF];


## -------------------------------------------------

!!safe_reverse;


## -------------------------------------------------

!!safe_forward;