2002-06-25 17:23:07 +00:00
|
|
|
#
|
2004-05-18 22:01:41 +00:00
|
|
|
# Copyright (C) 2002-2004, International Business Machines Corporation and others.
|
2002-08-09 03:14:43 +00:00
|
|
|
# All Rights Reserved.
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
2002-08-09 03:14:43 +00:00
|
|
|
# file: char.txt
|
|
|
|
#
|
|
|
|
# ICU Character Break Rules, also known as Grapheme Cluster Boundaries
|
2003-05-30 16:07:39 +00:00
|
|
|
# See Unicode Standard Annex #29.
|
|
|
|
# These rules are based on TR29 Version 4.0.0
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Character Class Definitions.
|
|
|
|
# The names are those from TR29.
|
|
|
|
#
|
|
|
|
$CR = \r;
|
|
|
|
$LF = \n;
|
2004-04-08 23:38:02 +00:00
|
|
|
$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:] - [:Grapheme_Extend = TRUE:]];
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2004-04-08 23:38:02 +00:00
|
|
|
$Extend = [[:Grapheme_Extend = TRUE:]];
|
2002-06-25 17:23:07 +00:00
|
|
|
|
|
|
|
#
|
2002-08-09 03:14:43 +00:00
|
|
|
# Korean Syllable Definitions
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
2003-04-04 23:41:03 +00:00
|
|
|
$L = [:Hangul_Syllable_Type = L:];
|
|
|
|
$V = [:Hangul_Syllable_Type = V:];
|
|
|
|
$T = [:Hangul_Syllable_Type = T:];
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-04-04 23:41:03 +00:00
|
|
|
$LV = [:Hangul_Syllable_Type = LV:];
|
|
|
|
$LVT = [:Hangul_Syllable_Type = LVT:];
|
|
|
|
|
2003-04-09 00:09:14 +00:00
|
|
|
$HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+;
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-11-07 02:02:06 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!forward;
|
|
|
|
|
2002-06-25 17:23:07 +00:00
|
|
|
$CR $LF;
|
2003-04-09 00:09:14 +00:00
|
|
|
([^$Control] | $HangulSyllable) $Extend*;
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-11-07 02:02:06 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!reverse;
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
$BackHangulSyllable = $L+ | ($T* ($V+$LV? | $LV | $LVT) $L*) | $T+;
|
|
|
|
$BackOneCluster = ($LF $CR) | ($Extend* ([^$Control] | $BackHangulSyllable));
|
2003-11-25 00:23:46 +00:00
|
|
|
$BackOneCluster;
|
2003-11-07 02:02:06 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_reverse;
|
|
|
|
|
2003-11-09 06:52:44 +00:00
|
|
|
# rule 6, 7, 8
|
|
|
|
$V+ $L;
|
2003-11-25 00:23:46 +00:00
|
|
|
|
2003-11-09 06:52:44 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_forward;
|
|
|
|
|
|
|
|
# rule 6, 7, 8
|
|
|
|
$V+ $T;
|