1ef0ff982e
X-SVN-Rev: 13613
177 lines
4.3 KiB
Plaintext
177 lines
4.3 KiB
Plaintext
#
|
|
# Copyright (C) 2002-2003,
|
|
# International Business Machines Corporation and others.
|
|
# All Rights Reserved.
|
|
#
|
|
# file: word.txt
|
|
#
|
|
# ICU Word Break Rules
|
|
# See Unicode Standard Annex #29.
|
|
# These rules are based on Version 4.0.0, dated 2003-04-17
|
|
#
|
|
|
|
##############################################################################
|
|
#
|
|
# Character class definitions from TR 29
|
|
#
|
|
##############################################################################
|
|
|
|
!!chain;
|
|
!!LBCMNoChain;
|
|
|
|
$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:]];
|
|
|
|
|
|
$ALetter = [[:Alphabetic:] [:name= HEBREW PUNCTUATION GERESH:]
|
|
- [:Ideographic:]
|
|
- $Katakana
|
|
- [:Script = Thai:]
|
|
- [:Script = Lao:]
|
|
- [:Script = Hiragana:]];
|
|
|
|
$ABaseLetter = [$ALetter - [:Grapheme_Extend = TRUE:]];
|
|
$ACMLetter = [$ALetter & [:Grapheme_Extend = TRUE:]];
|
|
|
|
$MidLetter = [[:name = APOSTROPHE:] [:name = MIDDLE DOT:]
|
|
[:name = HEBREW PUNCTUATION GERSHAYIM:]
|
|
[:name = RIGHT SINGLE QUOTATION MARK:]
|
|
[:name = HYPHENATION POINT:]];
|
|
|
|
$MidNumLet = [[:name = FULL STOP:] [:name = COLON:]];
|
|
|
|
$MidNum = [[:LineBreak = Infix_Numeric:] - $MidNumLet];
|
|
$Numeric = [:LineBreak = Numeric:];
|
|
|
|
#
|
|
# Character Class Definitions.
|
|
# The names are those from TR29.
|
|
#
|
|
|
|
$CR = \u000d;
|
|
$LF = \u000a;
|
|
$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:]];
|
|
$Extend = [[:Grapheme_Extend = TRUE:]];
|
|
$Format = [[:Cf:]];
|
|
$Hiragana = [:Hiragana:];
|
|
$Ideographic = [:IDEOGRAPHIC:];
|
|
|
|
## -------------------------------------------------
|
|
|
|
!!forward;
|
|
|
|
$CR $LF;
|
|
|
|
# rule 3 and 4
|
|
|
|
$ALetterEx = $ALetter $Extend*;
|
|
$ABaseLetterEx = $ABaseLetter $Extend*;
|
|
$NumericEx = $Numeric $Extend*;
|
|
$MidNumEx = $MidNum $Extend*;
|
|
$MidNumLetEx = $MidNumLet $Extend*;
|
|
$MidLetterEx = $MidLetter $Extend*;
|
|
$KatakanaEx = $Katakana $Extend*;
|
|
|
|
[^$Format] $Extend*;
|
|
|
|
# rule 5
|
|
|
|
$ALetterSeq = $ALetterEx ($Format* $ALetterEx)* {200};
|
|
|
|
# rule 6 and 7
|
|
|
|
$ALetterSeq
|
|
(
|
|
$Format*
|
|
($MidLetterEx | $MidNumLetEx)
|
|
$Format*
|
|
($ABaseLetterEx | $Format $ALetterSeq)
|
|
)*
|
|
{200};
|
|
|
|
# rule 8
|
|
|
|
$NumericEx ($Format* $NumericEx)* {100};
|
|
|
|
# rule 9
|
|
|
|
$ALetterEx ($Format* ($ALetterEx | $NumericEx))* {200};
|
|
|
|
# rule 10
|
|
|
|
$NumericEx + ($Format* $ALetterEx)+ ($Format* $NumericEx)* {200};
|
|
|
|
# rule 11 and 12
|
|
|
|
$NumericEx ($Format* ($MidNumEx | $MidNumLetEx) $Format* $NumericEx)+ {100};
|
|
|
|
# rule 13
|
|
|
|
$KatakanaEx ($Format* $KatakanaEx)* {300};
|
|
$Hiragana $Extend* {300};
|
|
$Ideographic $Extend* {400};
|
|
|
|
## -------------------------------------------------
|
|
|
|
!!reverse;
|
|
|
|
$BackALetterEx = $Extend* $ALetter;
|
|
$BackABaseLetterEx = $Extend* $ABaseLetter;
|
|
$BackACMLetterEx = $Extend* $ACMLetter;
|
|
$BackNumericEx = $Extend* $Numeric;
|
|
$BackMidNumEx = $Extend* $MidNum;
|
|
$BackMidNumLetEx = $Extend* $MidNumLet;
|
|
$BackMidLetterEx = $Extend* $MidLetter;
|
|
$BackKatakanaEx = $Extend* $Katakana;
|
|
|
|
$LF $CR;
|
|
|
|
$Extend* [^$Format];
|
|
|
|
# rule 5
|
|
|
|
($BackALetterEx $Format*)* $BackABaseLetterEx;
|
|
($BackALetterEx $Format*)* $BackACMLetterEx / $Format;
|
|
|
|
# rule 6 and 7
|
|
|
|
(
|
|
($BackALetterEx $Format*)*
|
|
($BackABaseLetterEx | $BackACMLetterEx $Format)
|
|
($Format* ($BackMidLetterEx | $BackMidNumLetEx))
|
|
)+
|
|
$Format* ($BackALetterEx $Format*)* $BackABaseLetterEx;
|
|
|
|
(
|
|
($BackALetterEx $Format*)*
|
|
($BackABaseLetterEx | $BackACMLetterEx $Format)
|
|
($Format* ($BackMidLetterEx | $BackMidNumLetEx))
|
|
)+
|
|
$Format* ($BackALetterEx $Format*)* $BackACMLetterEx / $Format;
|
|
|
|
# rule 8
|
|
|
|
$BackNumericEx $Format* $BackNumericEx;
|
|
|
|
# rule 9, 10
|
|
|
|
(($BackALetterEx | $BackNumericEx) $Format*)+ ($BackABaseLetterEx | $BackNumericEx);
|
|
(($BackALetterEx | $BackNumericEx) $Format*)+ $BackACMLetterEx / $Format;
|
|
|
|
# rule 11 and 12
|
|
|
|
$BackNumericEx $Format* ($BackMidNumEx | $BackMidNumLetEx) $Format* $BackNumericEx;
|
|
|
|
# rule 13
|
|
|
|
$BackKatakanaEx $Format* $BackKatakanaEx;
|
|
|
|
## -------------------------------------------------
|
|
|
|
!!safe_reverse;
|
|
|
|
$Extend* [^$Extend];
|
|
$BackACMLetterEx / $Format; |