2002-06-25 17:23:07 +00:00
|
|
|
#
|
2006-08-11 19:37:57 +00:00
|
|
|
# Copyright (C) 2002-2006, 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.
|
2006-08-11 19:37:57 +00:00
|
|
|
# These rules are based on TR29 Version 5.0.0
|
|
|
|
# Includes post-5.0 change to treat Japanese half width voicing marks
|
|
|
|
# as Grapheme Extend.
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Character Class Definitions.
|
|
|
|
#
|
2005-04-22 21:49:52 +00:00
|
|
|
$CR = [\p{Grapheme_Cluster_Break = CR}];
|
|
|
|
$LF = [\p{Grapheme_Cluster_Break = LF}];
|
|
|
|
$Control = [\p{Grapheme_Cluster_Break = Control}];
|
2006-08-11 19:37:57 +00:00
|
|
|
|
|
|
|
# add Japanese Half Width voicing marks to $Extend
|
|
|
|
$VoiceMarks = [\uff9e\uff9f];
|
|
|
|
$Extend = [\p{Grapheme_Cluster_Break = Extend} $VoiceMarks];
|
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
|
|
|
#
|
2005-04-22 21:49:52 +00:00
|
|
|
$L = [\p{Grapheme_Cluster_Break = L}];
|
|
|
|
$V = [\p{Grapheme_Cluster_Break = V}];
|
|
|
|
$T = [\p{Grapheme_Cluster_Break = T}];
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2005-04-22 21:49:52 +00:00
|
|
|
$LV = [\p{Grapheme_Cluster_Break = LV}];
|
|
|
|
$LVT = [\p{Grapheme_Cluster_Break = LVT}];
|
2003-04-04 23:41:03 +00:00
|
|
|
|
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;
|
2005-04-22 21:49:52 +00:00
|
|
|
([^$Control $CR $LF] | $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+;
|
2005-04-22 21:49:52 +00:00
|
|
|
$BackOneCluster = ($LF $CR) | ($Extend* ([^$Control $CR $LF] | $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;
|