]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/testdata/break_rules/word_POSIX.txt
ICU-57131.0.1.tar.gz
[apple/icu.git] / icuSources / test / testdata / break_rules / word_POSIX.txt
1 #
2 # Copyright (c) 2016, International Business Machines Corporation and others. All Rights Reserved.
3
4 # file: word_POSIX.txt
5 #
6 # Reference Word Break rules for intltest rbbi/RBBIMonkeyTest
7 #
8 # Note: Rule syntax and the monkey test itself are still a work in progress.
9 # They are expected to change with review and the addition of support for rule tailoring.
10
11 type = word; # one of grapheme | word | line | sentence
12 locale = en_US_POSIX;
13
14 E_Base = [\u261D\u26F9\u270A-\u270D\U0001F385\U0001F3C3-\U0001F3C4\U0001F3CA-\U0001F3CB\U0001F442-\U0001F443\U0001F446-\U0001F450\U0001F466-\U0001F469\U0001F46E\U0001F470-\U0001F478\U0001F47C\U0001F481-\U0001F483\U0001F485-\U0001F487\U0001F4AA\U0001F575\U0001F590\U0001F595-\U0001F596\U0001F645-\U0001F647\U0001F64B-\U0001F64F\U0001F6A3\U0001F6B4-\U0001F6B6\U0001F6C0\U0001F918];
15 E_Modifier = [\U0001F3FB-\U0001F3FF];
16 ZWJ = [\u200D];
17 GAZ = [\u2640\u2642\u2764\U0001F308\U0001F466-\U0001F469\U0001F48B\U0001F5E8];
18
19 CR = [\p{Word_Break = CR}];
20 LF = [\p{Word_Break = LF}];
21 Newline = [\p{Word_Break = Newline}];
22 Extend = [[[\p{Word_Break = Extend}][:Block=Tags:]]-ZWJ];
23 Regional_Indicator = [\p{Word_Break = Regional_Indicator}];
24 Format = [[\p{Word_Break = Format}]-[:Block=Tags:]];
25 Katakana = [\p{Word_Break = Katakana}];
26 Hebrew_Letter = [\p{Word_Break = Hebrew_Letter}];
27 ALetter = [\p{Word_Break = ALetter}];
28 Single_Quote = [\p{Word_Break = Single_Quote}];
29 Double_Quote = [\p{Word_Break = Double_Quote}];
30 MidNumLet = [\p{Word_Break = MidNumLet} - [.]];
31 MidLetter = [\p{Word_Break = MidLetter} - [\:]];
32 MidNum = [\p{Word_Break = MidNum} [.]];
33 Numeric = [\p{Word_Break = Numeric}];
34 ExtendNumLet = [\p{Word_Break = ExtendNumLet}];
35
36 #define dicitionary, with the effect being that those characters don't appear in test data.
37
38 Han = [:Han:];
39 Hiragana = [:Hiragana:];
40
41 Control = [\p{Grapheme_Cluster_Break = Control}];
42 HangulSyllable = [\uac00-\ud7a3];
43 ComplexContext = [:LineBreak = Complex_Context:];
44 KanaKanji = [Han Hiragana Katakana];
45 dictionaryCJK = [KanaKanji HangulSyllable];
46 dictionary = [ComplexContext dictionaryCJK];
47
48 # leave CJK scripts out of ALetterPlus
49 # Tricky. Redfine a set.
50 # For tailorings, if it modifies itself, do at end of sets ????
51 # Tweak redefine to mean replace existing definition at its original location.
52 # Insert defs without redefine just after last pre-existing def of that name.
53 # Maybe drop redefine, add warning for sets defined and not used, should catch typos.
54
55 ALetter = [ALetter - dictionary];
56
57 AHLetter = [ALetter Hebrew_Letter];
58 MidNumLetQ = [MidNumLet Single_Quote];
59 ExtFmt = [Extend Format ZWJ];
60
61 WB3: CR LF;
62 WB3a: (Newline | CR | LF) ÷;
63 WB3b: . ÷ (Newline | CR | LF); # actually redundant? No other rule combines.
64 # (but needed with UAX treat-as scheme.)
65 WB3c: ZWJ GAZ;
66
67 WB5: AHLetter ExtFmt* AHLetter;
68
69 # includes both WB6 and WB7
70 WB6: AHLetter ExtFmt* (MidLetter | MidNumLetQ) ExtFmt* AHLetter;
71
72 WB7a: Hebrew_Letter ExtFmt* Single_Quote;
73 WB7b: Hebrew_Letter ExtFmt* Double_Quote ExtFmt* Hebrew_Letter; # Include WB7c
74
75 WB8: Numeric ExtFmt* Numeric;
76 WB9: AHLetter ExtFmt* Numeric;
77 WB10: Numeric ExtFmt* AHLetter;
78
79 WB11: Numeric ExtFmt* (MidNum | MidNumLetQ) ExtFmt* Numeric; # includes WB12
80 WB13: Katakana ExtFmt* Katakana;
81
82 WB13a: (AHLetter | Numeric | Katakana | ExtendNumLet) ExtFmt* ExtendNumLet;
83 WB13b: ExtendNumLet ExtFmt* (AHLetter | Numeric | Katakana);
84
85 # WB rule 13c, pairs of Regional Indicators stay unbroken.
86 # Interacts with WB3c.
87 WB13c.1: Regional_Indicator ExtFmt* Regional_Indicator ExtFmt* ZWJ GAZ;
88 WB13c.2: Regional_Indicator ExtFmt* Regional_Indicator ExtFmt* ÷;
89
90 WB13d: (E_Base | GAZ) ExtFmt* E_Modifier;
91
92 # Rule WB 14 Any ÷ Any
93 # Interacts with WB3c, do not break between ZWJ and GAZ.
94 WB14.1: . ExtFmt* ZWJ GAZ;
95 WB14.2: . ExtFmt* ÷;
96