2002-06-25 17:23:07 +00:00
|
|
|
#
|
2005-03-08 22:49:59 +00:00
|
|
|
# Copyright (C) 2002-2005, International Business Machines Corporation
|
2004-11-01 23:54:44 +00:00
|
|
|
# and others. All Rights Reserved.
|
2002-08-09 03:14:43 +00:00
|
|
|
#
|
2003-11-25 00:23:46 +00:00
|
|
|
# file: word.txt
|
2002-08-09 03:14:43 +00:00
|
|
|
#
|
2003-11-05 23:50:39 +00:00
|
|
|
# ICU Word Break Rules
|
2003-04-08 05:35:13 +00:00
|
|
|
# See Unicode Standard Annex #29.
|
2005-01-11 00:49:22 +00:00
|
|
|
# These rules are based on Version 4.1 draft, dated 2004-11-11
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
##############################################################################
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
2003-04-08 05:35:13 +00:00
|
|
|
# Character class definitions from TR 29
|
2002-06-25 17:23:07 +00:00
|
|
|
#
|
2003-11-05 23:50:39 +00:00
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
!!chain;
|
|
|
|
|
2003-11-25 00:23:46 +00:00
|
|
|
$Katakana = [[:Script = KATAKANA:]
|
2005-01-11 00:49:22 +00:00
|
|
|
[:name = VERTICAL KANA REPEAT MARK:]
|
|
|
|
[:name = VERTICAL KANA REPEAT WITH VOICED SOUND MARK:]
|
|
|
|
[:name = VERTICAL KANA REPEAT MARK UPPER HALF:]
|
|
|
|
[:name = VERTICAL KANA REPEAT WITH VOICED SOUND MARK UPPER HALF:]
|
|
|
|
[:name = VERTICAL KANA REPEAT MARK LOWER HALF:]
|
|
|
|
[:name = KATAKANA-HIRAGANA VOICED SOUND MARK:]
|
|
|
|
[:name = KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK:]
|
|
|
|
[:name = KATAKANA-HIRAGANA DOUBLE HYPHEN:]
|
2003-11-25 00:23:46 +00:00
|
|
|
[:name = KATAKANA-HIRAGANA PROLONGED SOUND MARK:]
|
|
|
|
[:name = HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK:]
|
|
|
|
[:name = HALFWIDTH KATAKANA VOICED SOUND MARK:]
|
|
|
|
[:name = HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK:]];
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2002-07-22 22:02:08 +00:00
|
|
|
|
2003-11-25 00:23:46 +00:00
|
|
|
$ALetter = [[:Alphabetic:] [:name= HEBREW PUNCTUATION GERESH:]
|
|
|
|
- [:Ideographic:]
|
|
|
|
- $Katakana
|
2005-01-11 00:49:22 +00:00
|
|
|
- [:Script = Hiragana:]
|
2003-11-25 00:23:46 +00:00
|
|
|
- [:Script = Thai:]
|
|
|
|
- [:Script = Lao:]
|
2005-01-11 00:49:22 +00:00
|
|
|
- [:Grapheme_Extend = TRUE:]];
|
|
|
|
|
2003-11-25 00:23:46 +00:00
|
|
|
$MidLetter = [[:name = APOSTROPHE:] [:name = MIDDLE DOT:]
|
|
|
|
[:name = HEBREW PUNCTUATION GERSHAYIM:]
|
|
|
|
[:name = RIGHT SINGLE QUOTATION MARK:]
|
2005-01-11 00:49:22 +00:00
|
|
|
[:name = HYPHENATION POINT:]
|
|
|
|
[:name = COLON:]];
|
2004-10-25 23:50:11 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
|
|
|
|
$MidNum = [[:LineBreak = Infix_Numeric:] - [:name = COLON:]];
|
2003-04-08 05:35:13 +00:00
|
|
|
$Numeric = [:LineBreak = Numeric:];
|
2005-01-11 00:49:22 +00:00
|
|
|
$ExtendNumLet = [[:Connector_Punctuation:]
|
|
|
|
- [:name = KATAKANA MIDDLE DOT:]
|
|
|
|
- [:name = HALFWIDTH KATAKANA MIDDLE DOT:]];
|
|
|
|
|
|
|
|
|
2003-04-08 05:35:13 +00:00
|
|
|
|
2002-07-22 22:02:08 +00:00
|
|
|
#
|
2002-08-09 03:14:43 +00:00
|
|
|
# Character Class Definitions.
|
|
|
|
# The names are those from TR29.
|
|
|
|
#
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$CR = \u000d;
|
|
|
|
$LF = \u000a;
|
|
|
|
$Extend = [[:Grapheme_Extend = TRUE:]];
|
|
|
|
$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:] - $Extend];
|
|
|
|
$Format = [[:Cf:] - $Extend];
|
|
|
|
$Hiragana = [:Hiragana:];
|
|
|
|
$Ideographic = [:IDEOGRAPHIC:];
|
|
|
|
|
|
|
|
$ALetterEx = $ALetter $Extend*;
|
|
|
|
$NumericEx = $Numeric $Extend*;
|
|
|
|
$MidNumEx = $MidNum $Extend*;
|
|
|
|
$MidLetterEx = $MidLetter $Extend*;
|
|
|
|
$KatakanaEx = $Katakana $Extend*;
|
|
|
|
$ExtendNumLetEx = $ExtendNumLet $Extend*;
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!forward;
|
|
|
|
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
# Rule 3 - don't break grapheme clusters.
|
2003-11-11 05:00:08 +00:00
|
|
|
# see character breaks
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$CR $LF;
|
2005-01-13 23:42:12 +00:00
|
|
|
[^$Control] $Extend+;
|
2005-01-11 00:49:22 +00:00
|
|
|
$NumericEx $Extend* {100};
|
|
|
|
$ALetterEx $Extend* {200};
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
# rule 5
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$ALetterEx $Format* $ALetterEx {200};
|
2002-07-22 22:02:08 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
# rule 6 and 7
|
2005-01-11 00:49:22 +00:00
|
|
|
$ALetterEx $Format* $MidLetterEx $Format* $ALetterEx {200};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$NumericEx $Format* $NumericEx {100};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
# rule 9
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$ALetterEx $Format* $NumericEx {200};
|
2003-11-07 00:04:13 +00:00
|
|
|
|
|
|
|
# rule 10
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$NumericEx $Format* $ALetterEx {200};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$NumericEx $Format* $MidNumEx $Format* $NumericEx {100};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 13
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$KatakanaEx $Format* $KatakanaEx {300};
|
|
|
|
$Hiragana $Extend* {300};
|
2003-11-06 19:45:57 +00:00
|
|
|
$Ideographic $Extend* {400};
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
# rule 13a/b
|
|
|
|
|
|
|
|
$ALetterEx $Format* $ExtendNumLetEx {200}; # (13a)
|
|
|
|
$NumericEx $Format* $ExtendNumLetEx {100}; # (13a)
|
|
|
|
$KatakanaEx $Format* $ExtendNumLetEx {300}; # (13a)
|
|
|
|
$ExtendNumLetEx $Format* $ExtendNumLetEx{200}; # (13a)
|
|
|
|
|
|
|
|
$ExtendNumLetEx $Format* $ALetterEx {200}; # (13b)
|
|
|
|
$ExtendNumLetEx $Format* $NumericEx {100}; # (13b)
|
|
|
|
$ExtendNumLetEx $Format* $KatakanaEx {300}; # (13b)
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
!!reverse;
|
2002-07-24 19:10:18 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
$BackALetterEx = $Extend* $ALetter;
|
|
|
|
$BackNumericEx = $Extend* $Numeric;
|
|
|
|
$BackMidNumEx = $Extend* $MidNum;
|
|
|
|
$BackMidLetterEx = $Extend* $MidLetter;
|
|
|
|
$BackKatakanaEx = $Extend* $Katakana;
|
2005-01-11 00:49:22 +00:00
|
|
|
$BackExtendNumLetEx= $Extend* $ExtendNumLet;
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
$LF $CR;
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2003-11-11 05:00:08 +00:00
|
|
|
# see character breaks
|
|
|
|
|
|
|
|
$Extend* [^$Control];
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 5
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$BackALetterEx $Format* $BackALetterEx;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 6 and 7
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$BackALetterEx $Format* $BackMidLetterEx $Format* $BackALetterEx;
|
2004-10-25 23:50:11 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
2003-11-25 00:23:46 +00:00
|
|
|
$BackNumericEx $Format* $BackNumericEx;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
# rule 9
|
2004-10-25 23:50:11 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$BackNumericEx $Format* $BackALetterEx;
|
2003-11-11 05:00:08 +00:00
|
|
|
|
|
|
|
# rule 10
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$BackALetterEx $Format* $BackNumericEx;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
$BackNumericEx $Format* $BackMidNumEx $Format* $BackNumericEx;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 13
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
$BackKatakanaEx $Format* $BackKatakanaEx;
|
|
|
|
|
2005-01-11 00:49:22 +00:00
|
|
|
# rules 13 a/b
|
|
|
|
#
|
|
|
|
($BackALetterEx | $BackNumericEx | $BackKatakanaEx | $BackExtendNumLetEx) $Format* $BackExtendNumLetEx;
|
|
|
|
$BackExtendNumLetEx $Format* ($BackALetterEx | $BackNumericEx | $BackKatakanaEx);
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_reverse;
|
|
|
|
|
2003-11-09 06:52:44 +00:00
|
|
|
# rule 3
|
|
|
|
$Extend+ [^$Extend];
|
2004-05-17 02:49:46 +00:00
|
|
|
$Extend+; # comes into play when buffer _begins_ with an $Extend+.
|
2003-11-09 06:52:44 +00:00
|
|
|
|
|
|
|
# rule 4
|
2005-01-11 00:49:22 +00:00
|
|
|
$Format+ $BackALetterEx;
|
2003-11-09 06:52:44 +00:00
|
|
|
$Format+ $BackNumericEx;
|
|
|
|
$Format+ $BackMidLetterEx;
|
|
|
|
$Format+ $BackMidNumEx;
|
|
|
|
$Format+ $BackKatakanaEx;
|
2005-01-11 00:49:22 +00:00
|
|
|
$Format+ $BackExtendNumLetEx;
|
2003-11-09 06:52:44 +00:00
|
|
|
|
2004-05-17 02:49:46 +00:00
|
|
|
|
2003-11-09 06:52:44 +00:00
|
|
|
# rule 6
|
2005-01-11 00:49:22 +00:00
|
|
|
$MidLetter $Format* $BackALetterEx;
|
2003-11-09 06:52:44 +00:00
|
|
|
|
|
|
|
# rule 11
|
2005-01-11 00:49:22 +00:00
|
|
|
$MidNum $Format* $BackNumericEx;
|
2003-11-09 06:52:44 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_forward;
|
|
|
|
|
|
|
|
# rule 3
|
|
|
|
$Extend+;
|
|
|
|
|
|
|
|
# rule 4
|
2004-05-17 23:16:00 +00:00
|
|
|
$Extend* $Format+ $ALetterEx;
|
|
|
|
$Extend* $Format+ $NumericEx;
|
|
|
|
$Extend* $Format+ $MidLetterEx;
|
|
|
|
$Extend* $Format+ $MidNumEx;
|
|
|
|
$Extend* $Format+ $KatakanaEx;
|
2005-01-11 00:49:22 +00:00
|
|
|
$Extend* $Format+ $ExtendNumLetEx;
|
2004-05-17 23:16:00 +00:00
|
|
|
|
|
|
|
$Extend+ $Format* $ALetterEx;
|
|
|
|
$Extend+ $Format* $NumericEx;
|
|
|
|
$Extend+ $Format* $MidLetterEx;
|
|
|
|
$Extend+ $Format* $MidNumEx;
|
|
|
|
$Extend+ $Format* $KatakanaEx;
|
2005-01-11 00:49:22 +00:00
|
|
|
$Extend+ $Format* $ExtendNumLetEx;
|
2003-11-09 06:52:44 +00:00
|
|
|
|
|
|
|
# rule 6
|
2005-01-11 00:49:22 +00:00
|
|
|
$MidLetterEx $Format* $ALetterEx;
|
2003-11-09 06:52:44 +00:00
|
|
|
|
|
|
|
# rule 11
|
2005-01-11 00:49:22 +00:00
|
|
|
$MidNumEx $Format* $NumericEx;
|
|
|
|
|