2002-06-25 17:23:07 +00:00
|
|
|
#
|
2003-11-05 23:50:39 +00:00
|
|
|
# Copyright (C) 2002-2003,
|
|
|
|
# International Business Machines Corporation and others.
|
|
|
|
# All Rights Reserved.
|
2002-08-09 03:14:43 +00:00
|
|
|
#
|
2003-11-05 23:50:39 +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.
|
2003-05-29 21:15:14 +00:00
|
|
|
# These rules are based on Version 4.0.0, dated 2003-04-17
|
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-06 19:45:57 +00:00
|
|
|
!!LBCMNoChain;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
$Katakana = [[:Script = KATAKANA:]
|
|
|
|
[: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-04-08 05:35:13 +00:00
|
|
|
$ALetter = [[:Alphabetic:] [:name= HEBREW PUNCTUATION GERESH:]
|
|
|
|
- [:Ideographic:]
|
2003-05-29 21:15:14 +00:00
|
|
|
- $Katakana
|
2003-04-08 05:35:13 +00:00
|
|
|
- [:Script = Thai:]
|
|
|
|
- [:Script = Lao:]
|
|
|
|
- [:Script = Hiragana:]];
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
$ABaseLetter = [$ALetter - [:Grapheme_Extend = TRUE:]];
|
|
|
|
$ACMLetter = [$ALetter & [:Grapheme_Extend = TRUE:]];
|
2003-04-08 05:35:13 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
$MidLetter = [[:name = APOSTROPHE:] [:name = MIDDLE DOT:]
|
|
|
|
[:name = HEBREW PUNCTUATION GERSHAYIM:]
|
|
|
|
[:name = RIGHT SINGLE QUOTATION MARK:]
|
|
|
|
[:name = HYPHENATION POINT:]];
|
2003-04-08 05:35:13 +00:00
|
|
|
|
|
|
|
$MidNumLet = [[:name = FULL STOP:] [:name = COLON:]];
|
|
|
|
|
|
|
|
$MidNum = [[:LineBreak = Infix_Numeric:] - $MidNumLet];
|
|
|
|
$Numeric = [:LineBreak = Numeric:];
|
|
|
|
|
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.
|
|
|
|
#
|
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
$CR = \u000d;
|
|
|
|
$LF = \u000a;
|
|
|
|
$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:]];
|
|
|
|
$Extend = [[:Grapheme_Extend = TRUE:]];
|
|
|
|
$Format = [[:Cf:]];
|
|
|
|
$Hiragana = [:Hiragana:];
|
|
|
|
$Ideographic = [:IDEOGRAPHIC:];
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!forward;
|
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
$CR $LF;
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
# rule 3 and 4
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
$ALetterEx = $ALetter $Extend*;
|
|
|
|
$ABaseLetterEx = $ABaseLetter $Extend*;
|
|
|
|
$NumericEx = $Numeric $Extend*;
|
|
|
|
$MidNumEx = $MidNum $Extend*;
|
|
|
|
$MidNumLetEx = $MidNumLet $Extend*;
|
|
|
|
$MidLetterEx = $MidLetter $Extend*;
|
|
|
|
$KatakanaEx = $Katakana $Extend*;
|
2002-08-09 03:14:43 +00:00
|
|
|
|
2003-11-06 19:45:57 +00:00
|
|
|
[^$Format] $Extend*;
|
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
|
|
|
|
2003-11-06 19:45:57 +00:00
|
|
|
$ALetterSeq = $ALetterEx ($Format* $ALetterEx)* {200};
|
2002-07-22 22:02:08 +00:00
|
|
|
|
2003-11-05 23:50:39 +00:00
|
|
|
# rule 6 and 7
|
2002-07-22 22:02:08 +00:00
|
|
|
|
2003-11-06 19:45:57 +00:00
|
|
|
$ALetterSeq
|
|
|
|
(
|
|
|
|
$Format*
|
|
|
|
($MidLetterEx | $MidNumLetEx)
|
|
|
|
$Format*
|
|
|
|
($ABaseLetterEx | $Format $ALetterSeq)
|
|
|
|
)*
|
|
|
|
{200};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
|
|
|
$NumericEx ($Format* $NumericEx)* {100};
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
# rule 9
|
|
|
|
|
|
|
|
$ALetterEx ($Format* ($ALetterEx | $NumericEx))* {200};
|
|
|
|
|
|
|
|
# rule 10
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
$NumericEx + ($Format* $ALetterEx)+ ($Format* $NumericEx)* {200};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
$NumericEx ($Format* ($MidNumEx | $MidNumLetEx) $Format* $NumericEx)+ {100};
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 13
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2003-10-02 22:34:25 +00:00
|
|
|
$KatakanaEx ($Format* $KatakanaEx)* {300};
|
2003-11-06 19:45:57 +00:00
|
|
|
$Hiragana $Extend* {300};
|
|
|
|
$Ideographic $Extend* {400};
|
2002-06-25 17:23:07 +00:00
|
|
|
|
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;
|
|
|
|
$BackABaseLetterEx = $Extend* $ABaseLetter;
|
|
|
|
$BackACMLetterEx = $Extend* $ACMLetter;
|
|
|
|
$BackNumericEx = $Extend* $Numeric;
|
|
|
|
$BackMidNumEx = $Extend* $MidNum;
|
|
|
|
$BackMidNumLetEx = $Extend* $MidNumLet;
|
|
|
|
$BackMidLetterEx = $Extend* $MidLetter;
|
|
|
|
$BackKatakanaEx = $Extend* $Katakana;
|
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-07 00:04:13 +00:00
|
|
|
$Extend* [^$Format];
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 5
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
($BackALetterEx $Format*)* $BackABaseLetterEx;
|
|
|
|
($BackALetterEx $Format*)* $BackACMLetterEx / $Format;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 6 and 7
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
(
|
2003-11-06 19:45:57 +00:00
|
|
|
($BackALetterEx $Format*)*
|
|
|
|
($BackABaseLetterEx | $BackACMLetterEx $Format)
|
|
|
|
($Format* ($BackMidLetterEx | $BackMidNumLetEx))
|
|
|
|
)+
|
|
|
|
$Format* ($BackALetterEx $Format*)* $BackABaseLetterEx;
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
(
|
2003-11-06 19:45:57 +00:00
|
|
|
($BackALetterEx $Format*)*
|
|
|
|
($BackABaseLetterEx | $BackACMLetterEx $Format)
|
|
|
|
($Format* ($BackMidLetterEx | $BackMidNumLetEx))
|
|
|
|
)+
|
|
|
|
$Format* ($BackALetterEx $Format*)* $BackACMLetterEx / $Format;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
$BackNumericEx $Format* $BackNumericEx;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2003-11-06 20:04:39 +00:00
|
|
|
# rule 9, 10
|
2003-11-05 23:50:39 +00:00
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
(($BackALetterEx | $BackNumericEx) $Format*)+ ($BackABaseLetterEx | $BackNumericEx);
|
|
|
|
(($BackALetterEx | $BackNumericEx) $Format*)+ $BackACMLetterEx / $Format;
|
2003-11-05 23:50:39 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2003-11-07 00:04:13 +00:00
|
|
|
$BackNumericEx $Format* ($BackMidNumEx | $BackMidNumLetEx) $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;
|
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_reverse;
|
|
|
|
|
|
|
|
$Extend* [^$Extend];
|
|
|
|
$BackACMLetterEx / $Format;
|