#
-# Copyright (C) 2002-2003, International Business Machines Corporation and others.
+# Copyright (C) 2002-2010, 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
+# These rules are based on TR29 Revision 16, for Unicode Version 6.0
#
#
# Character Class Definitions.
-# The names are those from TR29.
#
-$CR = \r;
-$LF = \n;
-$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:]];
-
-$Extend = [[:Grapheme_Extend = TRUE:]];
+$CR = [\p{Grapheme_Cluster_Break = CR}];
+$LF = [\p{Grapheme_Cluster_Break = LF}];
+$Control = [\p{Grapheme_Cluster_Break = Control}];
+$Prepend = [\p{Grapheme_Cluster_Break = Prepend}];
+$Extend = [\p{Grapheme_Cluster_Break = Extend}];
+$SpacingMark = [\p{Grapheme_Cluster_Break = SpacingMark}];
#
# Korean Syllable Definitions
#
-$L = [:Hangul_Syllable_Type = L:];
-$V = [:Hangul_Syllable_Type = V:];
-$T = [:Hangul_Syllable_Type = T:];
+$L = [\p{Grapheme_Cluster_Break = L}];
+$V = [\p{Grapheme_Cluster_Break = V}];
+$T = [\p{Grapheme_Cluster_Break = T}];
-$LV = [:Hangul_Syllable_Type = LV:];
-$LVT = [:Hangul_Syllable_Type = LVT:];
+$LV = [\p{Grapheme_Cluster_Break = LV}];
+$LVT = [\p{Grapheme_Cluster_Break = LVT}];
-$HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+;
-#
-# Forward Break Rules
-#
+## -------------------------------------------------
+!!chain;
+
+!!forward;
+
$CR $LF;
-([^$Control] | $HangulSyllable) $Extend*;
-.;
+$L ($L | $V | $LV | $LVT);
+($LV | $V) ($V | $T);
+($LVT | $T) $T;
+
+[^$Control $CR $LF] $Extend;
+
+[^$Control $CR $LF] $SpacingMark;
+$Prepend [^$Control $CR $LF];
+
+
+## -------------------------------------------------
+
+!!reverse;
+$LF $CR;
+($L | $V | $LV | $LVT) $L;
+($V | $T) ($LV | $V);
+$T ($LVT | $T);
+
+$Extend [^$Control $CR $LF];
+$SpacingMark [^$Control $CR $LF];
+[^$Control $CR $LF] $Prepend;
+
+
+## -------------------------------------------------
+
+!!safe_reverse;
+
+
+## -------------------------------------------------
+
+!!safe_forward;
-#
-# Reverse Rule, back up to the beginning of some preceding grapheme cluster.
-#
-! ($Extend | $V | $T )* ($LF $CR | ($LV | $LVT)?$L* | .);