2004-10-21 01:03:01 +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.
|
2004-10-21 01:03:01 +00:00
|
|
|
#
|
|
|
|
# file: word_ja.txt
|
|
|
|
#
|
|
|
|
# ICU Word Break Rules
|
|
|
|
# See Unicode Standard Annex #29.
|
2005-04-22 21:49:52 +00:00
|
|
|
# These rules are based on Unicode Version 4.1
|
2004-10-21 01:03:01 +00:00
|
|
|
#
|
2005-04-22 21:49:52 +00:00
|
|
|
# Note: Updates to word.txt will usually need to be merged into
|
|
|
|
# word_POSIX.txt and word+ja.txt also.
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# Character class definitions from TR 29
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
!!chain;
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Character Class Definitions.
|
|
|
|
#
|
|
|
|
|
2005-04-22 21:49:52 +00:00
|
|
|
$Format = [\p{Word_Break = Format}];
|
|
|
|
$Katakana = [\p{Word_Break = Katakana}];
|
|
|
|
$ALetter = [\p{Word_Break = ALetter}];
|
|
|
|
$MidLetter = [\p{Word_Break = MidLetter}];
|
|
|
|
$MidNum = [\p{Word_Break = MidNum}];
|
|
|
|
$Numeric = [\p{Word_Break = Numeric}];
|
|
|
|
$ExtendNumLet = [\p{Word_Break = ExtendNumLet}];
|
|
|
|
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$CR = \u000d;
|
|
|
|
$LF = \u000a;
|
2005-04-22 21:49:52 +00:00
|
|
|
$Extend = [\p{Grapheme_Cluster_Break = Extend}];
|
|
|
|
$Control = [\p{Grapheme_Cluster_Break = Control}];
|
2005-01-13 23:42:12 +00:00
|
|
|
|
2005-04-22 21:49:52 +00:00
|
|
|
$KatakanaEx = $Katakana $Extend*;
|
2005-01-13 23:42:12 +00:00
|
|
|
$ALetterEx = $ALetter $Extend*;
|
|
|
|
$MidLetterEx = $MidLetter $Extend*;
|
2005-04-22 21:49:52 +00:00
|
|
|
$MidNumEx = $MidNum $Extend*;
|
|
|
|
$NumericEx = $Numeric $Extend*;
|
|
|
|
$ExtendNumLetEx = $ExtendNumLet $Extend*;
|
|
|
|
|
|
|
|
$Hiragana = [:Hiragana:];
|
|
|
|
$Ideographic = [:IDEOGRAPHIC:];
|
2005-01-13 23:42:12 +00:00
|
|
|
$HiraganaEx = $Hiragana $Extend*;
|
|
|
|
$IdeographicEx = $Ideographic $Extend*;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!forward;
|
|
|
|
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
# Rule 3 - don't break grapheme clusters.
|
2005-04-22 21:49:52 +00:00
|
|
|
# see character breaks.
|
2004-10-21 01:03:01 +00:00
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$CR $LF;
|
2005-04-22 21:49:52 +00:00
|
|
|
[^$Control $CR $LF] $Extend+;
|
2005-01-13 23:42:12 +00:00
|
|
|
$NumericEx {100};
|
|
|
|
$ALetterEx {200};
|
|
|
|
$KatakanaEx {300};
|
|
|
|
$HiraganaEx {300};
|
|
|
|
$IdeographicEx {400};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 5
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$ALetterEx $Format* $ALetterEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 6 and 7
|
2005-01-13 23:42:12 +00:00
|
|
|
$ALetterEx $Format* $MidLetterEx $Format* $ALetterEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$NumericEx $Format* $NumericEx {100};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 9
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$ALetterEx $Format* $NumericEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 10
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$NumericEx $Format* $ALetterEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$NumericEx $Format* $MidNumEx $Format* $NumericEx {100};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 13
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$KatakanaEx $Format* $KatakanaEx {300};
|
|
|
|
$HiraganaEx $Format* $HiraganaEx {300};
|
|
|
|
$IdeographicEx $Format* $IdeographicEx {400};
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
|
|
|
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!reverse;
|
|
|
|
|
|
|
|
$BackALetterEx = $Extend* $ALetter;
|
|
|
|
$BackNumericEx = $Extend* $Numeric;
|
|
|
|
$BackMidNumEx = $Extend* $MidNum;
|
|
|
|
$BackMidLetterEx = $Extend* $MidLetter;
|
|
|
|
$BackKatakanaEx = $Extend* $Katakana;
|
|
|
|
$BackHiraganaEx = $Extend* $Hiragana;
|
|
|
|
$BackIdeographicEx = $Extend* $Ideographic;
|
2005-01-13 23:42:12 +00:00
|
|
|
$BackExtendNumLetEx= $Extend* $ExtendNumLet;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
$LF $CR;
|
|
|
|
|
|
|
|
# see character breaks
|
|
|
|
|
2005-04-22 21:49:52 +00:00
|
|
|
$Extend* [^$Control $CR $LF];
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 5
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$BackALetterEx $Format* $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 6 and 7
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$BackALetterEx $Format* $BackMidLetterEx $Format* $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
|
|
|
$BackNumericEx $Format* $BackNumericEx;
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
# rule 9
|
2004-10-21 01:03:01 +00:00
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$BackNumericEx $Format* $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 10
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$BackALetterEx $Format* $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
$BackNumericEx $Format* $BackMidNumEx $Format* $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 13
|
|
|
|
|
|
|
|
$BackKatakanaEx $Format* $BackKatakanaEx;
|
|
|
|
$BackHiraganaEx $Format* $BackHiraganaEx;
|
|
|
|
$BackIdeographicEx $Format* $BackIdeographicEx;
|
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
# rules 13 a/b
|
|
|
|
#
|
|
|
|
($BackALetterEx | $BackNumericEx | $BackKatakanaEx | $BackExtendNumLetEx) $Format* $BackExtendNumLetEx;
|
|
|
|
$BackExtendNumLetEx $Format* ($BackALetterEx | $BackNumericEx | $BackKatakanaEx);
|
|
|
|
|
2004-10-21 01:03:01 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_reverse;
|
|
|
|
|
|
|
|
# rule 3
|
|
|
|
$Extend+ [^$Extend];
|
|
|
|
$Extend+; # comes into play when buffer _begins_ with an $Extend+.
|
|
|
|
|
|
|
|
# rule 4
|
2005-01-13 23:42:12 +00:00
|
|
|
$Format+ $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
$Format+ $BackNumericEx;
|
|
|
|
$Format+ $BackMidLetterEx;
|
|
|
|
$Format+ $BackMidNumEx;
|
|
|
|
$Format+ $BackKatakanaEx;
|
|
|
|
$Format+ $BackHiraganaEx;
|
|
|
|
$Format+ $BackIdeographicEx;
|
2005-01-13 23:42:12 +00:00
|
|
|
$Format+ $BackExtendNumLetEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rule 6
|
2005-01-13 23:42:12 +00:00
|
|
|
$MidLetter $Format* $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11
|
2005-01-13 23:42:12 +00:00
|
|
|
$MidNum $Format* $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_forward;
|
|
|
|
|
|
|
|
# rule 3
|
|
|
|
$Extend+;
|
|
|
|
|
|
|
|
# rule 4
|
|
|
|
$Extend* $Format+ $ALetterEx;
|
|
|
|
$Extend* $Format+ $NumericEx;
|
|
|
|
$Extend* $Format+ $MidLetterEx;
|
|
|
|
$Extend* $Format+ $MidNumEx;
|
|
|
|
$Extend* $Format+ $KatakanaEx;
|
|
|
|
$Extend* $Format+ $HiraganaEx;
|
|
|
|
$Extend* $Format+ $IdeographicEx;
|
2005-01-13 23:42:12 +00:00
|
|
|
$Extend* $Format+ $ExtendNumLetEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
$Extend+ $Format* $ALetterEx;
|
|
|
|
$Extend+ $Format* $NumericEx;
|
|
|
|
$Extend+ $Format* $MidLetterEx;
|
|
|
|
$Extend+ $Format* $MidNumEx;
|
|
|
|
$Extend+ $Format* $KatakanaEx;
|
|
|
|
$Extend+ $Format* $HiraganaEx;
|
|
|
|
$Extend+ $Format* $IdeographicEx;
|
2005-01-13 23:42:12 +00:00
|
|
|
$Extend+ $Format* $ExtendNumLetEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 6
|
2005-01-13 23:42:12 +00:00
|
|
|
$MidLetterEx $Format* $ALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11
|
2005-01-13 23:42:12 +00:00
|
|
|
$MidNumEx $Format* $NumericEx;
|
2005-04-22 21:49:52 +00:00
|
|
|
|