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
|
2005-09-10 03:52:54 +00:00
|
|
|
# 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-09-10 03:52:54 +00:00
|
|
|
#
|
|
|
|
# Rules 3 Grapheme Clusters behave like their first char.
|
|
|
|
# Rule 4 Ignore trailing Format characters (Also see note in TR 29)
|
|
|
|
#
|
|
|
|
$KatakanaEx = $Katakana $Extend* $Format*;
|
|
|
|
$ALetterEx = $ALetter $Extend* $Format*;
|
|
|
|
$MidLetterEx = $MidLetter $Extend* $Format*;
|
|
|
|
$MidNumEx = $MidNum $Extend* $Format*;
|
|
|
|
$NumericEx = $Numeric $Extend* $Format*;
|
|
|
|
$ExtendNumLetEx = $ExtendNumLet $Extend* $Format*;
|
2005-04-22 21:49:52 +00:00
|
|
|
|
|
|
|
$Hiragana = [:Hiragana:];
|
|
|
|
$Ideographic = [:IDEOGRAPHIC:];
|
2005-09-10 03:52:54 +00:00
|
|
|
$HiraganaEx = $Hiragana $Extend* $Format*;
|
|
|
|
$IdeographicEx = $Ideographic $Extend* $Format*;
|
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-09-10 03:52:54 +00:00
|
|
|
$CR $LF $Format*;
|
|
|
|
[^$Control $CR $LF] $Extend+ $Format*;
|
|
|
|
[^$Control $CR $LF] $Extend* $Format+;
|
|
|
|
|
|
|
|
# Rule 4 - ignore trailing format characters
|
|
|
|
# For the most part, trailing formats are handled by the $<whatever>Ex
|
|
|
|
# definitions above. The rule here comes into play when the start of text
|
|
|
|
# begins with a group of Format chars, or with "word" consisting of a single
|
|
|
|
# char that is not in any of the listed word break categories followed by
|
|
|
|
# format char(s).
|
|
|
|
.? $Format+;
|
|
|
|
|
|
|
|
|
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-09-10 03:52:54 +00:00
|
|
|
$ALetterEx $ALetterEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 6 and 7
|
2005-09-10 03:52:54 +00:00
|
|
|
$ALetterEx $MidLetterEx $ALetterEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$NumericEx $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-09-10 03:52:54 +00:00
|
|
|
$NumericEx $ALetterEx {200};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$NumericEx $MidNumEx $NumericEx {100};
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 13
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$KatakanaEx $KatakanaEx {300};
|
|
|
|
$HiraganaEx $HiraganaEx {300};
|
|
|
|
$IdeographicEx $IdeographicEx {400};
|
2005-01-13 23:42:12 +00:00
|
|
|
|
|
|
|
# rule 13a/b
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$ALetterEx $ExtendNumLetEx {200}; # (13a)
|
|
|
|
$NumericEx $ExtendNumLetEx {100}; # (13a)
|
|
|
|
$KatakanaEx $ExtendNumLetEx {300}; # (13a)
|
|
|
|
$ExtendNumLetEx $ExtendNumLetEx{200}; # (13a)
|
2005-01-13 23:42:12 +00:00
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$ExtendNumLetEx $ALetterEx {200}; # (13b)
|
|
|
|
$ExtendNumLetEx $NumericEx {100}; # (13b)
|
|
|
|
$ExtendNumLetEx $KatakanaEx {300}; # (13b)
|
2005-01-13 23:42:12 +00:00
|
|
|
|
|
|
|
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!reverse;
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackALetterEx = $Format* $Extend* $ALetter;
|
|
|
|
$BackNumericEx = $Format* $Extend* $Numeric;
|
|
|
|
$BackMidNumEx = $Format* $Extend* $MidNum;
|
|
|
|
$BackMidLetterEx = $Format* $Extend* $MidLetter;
|
|
|
|
$BackKatakanaEx = $Format* $Extend* $Katakana;
|
|
|
|
$BackExtendNumLetEx= $Format* $Extend* $ExtendNumLet;
|
|
|
|
$BackHiraganaEx = $Format* $Extend* $Hiragana;
|
|
|
|
$BackIdeographicEx = $Format* $Extend* $Ideographic;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$Format* $LF $CR;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# see character breaks
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$Format* $Extend* [^$Control $CR $LF];
|
|
|
|
$Format+ .?;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 5
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackALetterEx $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 6 and 7
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackALetterEx $BackMidLetterEx $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rule 8
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackNumericEx $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
# rule 9
|
2004-10-21 01:03:01 +00:00
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackNumericEx $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 10
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackALetterEx $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11 and 12
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackNumericEx $BackMidNumEx $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 13
|
|
|
|
|
2005-09-10 03:52:54 +00:00
|
|
|
$BackKatakanaEx $BackKatakanaEx;
|
|
|
|
$BackHiraganaEx $BackHiraganaEx;
|
|
|
|
$BackIdeographicEx $BackIdeographicEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
2005-01-13 23:42:12 +00:00
|
|
|
# rules 13 a/b
|
|
|
|
#
|
2005-09-10 03:52:54 +00:00
|
|
|
($BackALetterEx | $BackNumericEx | $BackKatakanaEx | $BackExtendNumLetEx) $BackExtendNumLetEx;
|
|
|
|
$BackExtendNumLetEx ($BackALetterEx | $BackNumericEx | $BackKatakanaEx);
|
2005-01-13 23:42:12 +00:00
|
|
|
|
2004-10-21 01:03:01 +00:00
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_reverse;
|
|
|
|
|
|
|
|
# rule 3
|
|
|
|
$Extend+ [^$Extend];
|
2005-09-10 03:52:54 +00:00
|
|
|
$Format+ $Extend* [^$Extend];
|
2004-10-21 01:03:01 +00:00
|
|
|
$Extend+; # comes into play when buffer _begins_ with an $Extend+.
|
2005-09-10 03:52:54 +00:00
|
|
|
$Format+;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rule 6
|
2005-09-10 03:52:54 +00:00
|
|
|
$MidLetter $BackALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11
|
2005-09-10 03:52:54 +00:00
|
|
|
$MidNum $BackNumericEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
## -------------------------------------------------
|
|
|
|
|
|
|
|
!!safe_forward;
|
|
|
|
|
|
|
|
# rule 3
|
2005-09-10 03:52:54 +00:00
|
|
|
$Extend+ $Format*;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# 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-09-10 03:52:54 +00:00
|
|
|
$MidLetterEx $ALetterEx;
|
2004-10-21 01:03:01 +00:00
|
|
|
|
|
|
|
# rule 11
|
2005-09-10 03:52:54 +00:00
|
|
|
$MidNumEx $NumericEx;
|
2005-04-22 21:49:52 +00:00
|
|
|
|