#
-# Copyright (C) 2002-2003, International Business Machines Corporation and others.
+# Copyright (C) 2002-2004, International Business Machines Corporation and others.
# All Rights Reserved.
#
# file: char.txt
#
$CR = \r;
$LF = \n;
-$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:]];
+$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:] - [:Grapheme_Extend = TRUE:]];
-$Extend = [[:Grapheme_Extend = TRUE:]];
+$Extend = [[:Grapheme_Extend = TRUE:]];
#
# Korean Syllable Definitions
$HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+;
-#
-# Forward Break Rules
-#
+## -------------------------------------------------
+
+!!forward;
+
$CR $LF;
([^$Control] | $HangulSyllable) $Extend*;
-.;
+## -------------------------------------------------
-#
-# Reverse Rule, back up to the beginning of some preceding grapheme cluster.
-#
-! ($Extend | $V | $T )* ($LF $CR | ($LV | $LVT)?$L* | .);
+!!reverse;
+
+$BackHangulSyllable = $L+ | ($T* ($V+$LV? | $LV | $LVT) $L*) | $T+;
+$BackOneCluster = ($LF $CR) | ($Extend* ([^$Control] | $BackHangulSyllable));
+$BackOneCluster;
+
+## -------------------------------------------------
+
+!!safe_reverse;
+
+# rule 6, 7, 8
+$V+ $L;
+
+## -------------------------------------------------
+
+!!safe_forward;
+
+# rule 6, 7, 8
+$V+ $T;