Imported Upstream version 58.1
[platform/upstream/icu.git] / source / test / testdata / break_rules / word_POSIX.txt
1 #
2 # Copyright (C) 2016 and later: Unicode, Inc. and others.
3 # License & terms of use: http://www.unicode.org/copyright.html
4 # Copyright (c) 2016, International Business Machines Corporation and others. All Rights Reserved.
5
6 # file: word_POSIX.txt
7 #
8 # Reference Word Break rules for intltest rbbi/RBBIMonkeyTest
9 #
10 # Note: Rule syntax and the monkey test itself are still a work in progress.
11 #       They are expected to change with review and the addition of support for rule tailoring.
12
13 type = word;      # one of grapheme | word | line | sentence
14 locale = en_US_POSIX;
15
16
17 CR                 = [\p{Word_Break = CR}];
18 LF                 = [\p{Word_Break = LF}];
19 Newline            = [\p{Word_Break = Newline}];
20 Extend             = [\p{Word_Break = Extend}];
21 ZWJ                = [\p{Word_Break = ZWJ}];
22 Regional_Indicator = [\p{Word_Break = Regional_Indicator}];
23 Format             = [\p{Word_Break = Format}];
24 Katakana           = [\p{Word_Break = Katakana}];
25 Hebrew_Letter      = [\p{Word_Break = Hebrew_Letter}];
26 ALetter            = [\p{Word_Break = ALetter}];
27 Single_Quote       = [\p{Word_Break = Single_Quote}];
28 Double_Quote       = [\p{Word_Break = Double_Quote}];
29 MidNumLet          = [\p{Word_Break = MidNumLet} - [.]];
30 MidLetter          = [\p{Word_Break = MidLetter} - [\:]];
31 MidNum             = [\p{Word_Break = MidNum} [.]];
32 Numeric            = [\p{Word_Break = Numeric}];
33 ExtendNumLet       = [\p{Word_Break = ExtendNumLet}];
34 E_Base             = [\p{Word_Break = EB}\U0001F3C2\U0001F3C7\U0001F3CC\U0001F46A-\U0001F46D\U0001F46F\U0001F574\U0001F6CC];
35 E_Modifier         = [\p{Word_Break = EM}];
36 EmojiNRK           = [[\p{Emoji}] - [[Regional_Indicator]\u002a\u00230-9©®™〰〽]];
37 # Data for Extended Pictographic scraped from CLDR common/properties/ExtendedPictographic.txt, r12773
38 Extended_Pict      = [\U0001F774-\U0001F77F\u2700-\u2701\u2703-\u2704\u270E\u2710-\u2711\u2765-\u2767\U0001F030-\U0001F093\U0001F094-\U0001F09F\U0001F10D-\U0001F10F\U0001F12F\U0001F16C-\U0001F16F\U0001F1AD-\U0001F1E5\U0001F203-\U0001F20F\U0001F23C-\U0001F23F\U0001F249-\U0001F24F\U0001F252-\U0001F2FF\U0001F7D5-\U0001F7FF\U0001F000-\U0001F003\U0001F005-\U0001F02B\U0001F02C-\U0001F02F\U0001F322-\U0001F323\U0001F394-\U0001F395\U0001F398\U0001F39C-\U0001F39D\U0001F3F1-\U0001F3F2\U0001F3F6\U0001F4FE\U0001F53E-\U0001F548\U0001F54F\U0001F568-\U0001F56E\U0001F571-\U0001F572\U0001F57B-\U0001F586\U0001F588-\U0001F589\U0001F58E-\U0001F58F\U0001F591-\U0001F594\U0001F597-\U0001F5A3\U0001F5A6-\U0001F5A7\U0001F5A9-\U0001F5B0\U0001F5B3-\U0001F5BB\U0001F5BD-\U0001F5C1\U0001F5C5-\U0001F5D0\U0001F5D4-\U0001F5DB\U0001F5DF-\U0001F5E0\U0001F5E2\U0001F5E4-\U0001F5E7\U0001F5E9-\U0001F5EE\U0001F5F0-\U0001F5F2\U0001F5F4-\U0001F5F9\u2605\u2607-\u260D\u260F-\u2610\u2612\u2616-\u2617\u2619-\u261C\u261E-\u261F\u2621\u2624-\u2625\u2627-\u2629\u262B-\u262D\u2630-\u2637\u263B-\u2647\u2654-\u265F\u2661-\u2662\u2664\u2667\u2669-\u267A\u267C-\u267E\u2680-\u2691\u2695\u2698\u269A\u269D-\u269F\u26A2-\u26A9\u26AC-\u26AF\u26B2-\u26BC\u26BF-\u26C3\u26C6-\u26C7\u26C9-\u26CD\u26D0\u26D2\u26D5-\u26E8\u26EB-\u26EF\u26F6\u26FB-\u26FC\u26FE-\u26FF\u2388\U0001FA00-\U0001FFFD\U0001F0A0-\U0001F0AE\U0001F0B1-\U0001F0BF\U0001F0C1-\U0001F0CF\U0001F0D1-\U0001F0F5\U0001F0AF-\U0001F0B0\U0001F0C0\U0001F0D0\U0001F0F6-\U0001F0FF\U0001F80C-\U0001F80F\U0001F848-\U0001F84F\U0001F85A-\U0001F85F\U0001F888-\U0001F88F\U0001F8AE-\U0001F8FF\U0001F900-\U0001F90F\U0001F91F\U0001F928-\U0001F92F\U0001F931-\U0001F932\U0001F93F\U0001F94C-\U0001F94F\U0001F95F-\U0001F97F\U0001F992-\U0001F9BF\U0001F9C1-\U0001F9FF\U0001F6C6-\U0001F6CA\U0001F6E6-\U0001F6E8\U0001F6EA\U0001F6F1-\U0001F6F2\U0001F6D3-\U0001F6DF\U0001F6ED-\U0001F6EF\U0001F6F7-\U0001F6FF];
39 EBG                = [\p{Word_Break = EBG}];
40
41 #define dicitionary, with the effect being that those characters don't appear in test data.
42
43 Han            = [:Han:];
44 Hiragana       = [:Hiragana:];
45
46 Control        = [\p{Grapheme_Cluster_Break = Control}];
47 HangulSyllable = [\uac00-\ud7a3];
48 ComplexContext = [:LineBreak = Complex_Context:];
49 KanaKanji      = [Han Hiragana Katakana];
50 dictionaryCJK  = [KanaKanji HangulSyllable];
51 dictionary     = [ComplexContext dictionaryCJK];
52
53 # leave CJK scripts out of ALetterPlus
54 #   Tricky. Redfine a set.
55 #   For tailorings, if it modifies itself, do at end of sets ????
56 #   Tweak redefine to mean replace existing definition at its original location.
57 #   Insert defs without redefine just after last pre-existing def of that name.
58 #   Maybe drop redefine, add warning for sets defined and not used, should catch typos.
59
60 ALetter        = [ALetter - dictionary];
61
62 AHLetter       = [ALetter  Hebrew_Letter];
63 MidNumLetQ     = [MidNumLet  Single_Quote];
64 ExtFmt         = [Extend Format ZWJ];
65
66 WB3:   CR LF;
67 WB3a:  (Newline | CR | LF) ÷;
68 WB3b:  . ÷ (Newline | CR | LF);   # actually redundant? No other rule combines.
69                                   # (but needed with UAX treat-as scheme.)
70 WB3c:   ZWJ (Extended_Pict | EmojiNRK);
71
72 WB5:    AHLetter ExtFmt* AHLetter;
73
74 # includes both WB6 and WB7
75 WB6:    AHLetter ExtFmt* (MidLetter | MidNumLetQ) ExtFmt*  AHLetter;
76
77 WB7a:   Hebrew_Letter ExtFmt* Single_Quote;
78 WB7b:   Hebrew_Letter ExtFmt* Double_Quote ExtFmt* Hebrew_Letter;   # Include WB7c
79
80 WB8:    Numeric ExtFmt* Numeric;
81 WB9:    AHLetter ExtFmt* Numeric;
82 WB10:   Numeric ExtFmt* AHLetter;
83
84 WB11:   Numeric ExtFmt* (MidNum | MidNumLetQ) ExtFmt* Numeric;    # includes WB12
85 WB13:   Katakana ExtFmt* Katakana;
86
87 WB13a:  (AHLetter | Numeric | Katakana | ExtendNumLet) ExtFmt* ExtendNumLet;
88 WB13b:  ExtendNumLet ExtFmt* (AHLetter | Numeric | Katakana);
89
90 # WB rule 15 - 17, pairs of Regional Indicators stay unbroken.
91 #              Interacts with WB3c.
92 WB15:  Regional_Indicator ExtFmt* Regional_Indicator ExtFmt* ZWJ (Extended_Pict | EmojiNRK);
93 WB17:  Regional_Indicator ExtFmt* Regional_Indicator ExtFmt* ÷;
94
95 WB14:  (E_Base | EBG) ExtFmt* E_Modifier;
96
97 # Rule WB 999   Any ÷ Any
98 #    Interacts with WB3c, do not break between ZWJ and (Extended_Pict | EBG).
99 WB999.1: . ExtFmt* ZWJ (Extended_Pict | EmojiNRK);
100 WB999.2: . ExtFmt* ÷;
101