summaryrefslogtreecommitdiffstats
path: root/intl/icu/source/test/testdata/break_rules/word.txt
blob: 8594055f71f9b4ace259020c12823e2326460313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (c) 2016, International Business Machines Corporation and others. All Rights Reserved.

# file: word.txt
#
# Reference Word Break rules for intltest rbbi/RBBIMonkeyTest
#
# Note: Rule syntax and the monkey test itself are still a work in progress.
#       They are expected to change with review and the addition of support for rule tailoring.


type = word;      # one of grapheme | word | line | sentence
locale = en;

Han            = [:Han:];

CR                 = [\p{Word_Break = CR}];
LF                 = [\p{Word_Break = LF}];
Newline            = [\p{Word_Break = Newline}];
Extend             = [\p{Word_Break = Extend}-Han];
ZWJ                = [\p{Word_Break = ZWJ}];
Regional_Indicator = [\p{Word_Break = Regional_Indicator}];
Format             = [\p{Word_Break = Format}];
Katakana           = [\p{Word_Break = Katakana}];
Hebrew_Letter      = [\p{Word_Break = Hebrew_Letter}];
ALetter            = [\p{Word_Break = ALetter} @];
Single_Quote       = [\p{Word_Break = Single_Quote}];
Double_Quote       = [\p{Word_Break = Double_Quote}];
MidNumLet          = [\p{Word_Break = MidNumLet}];
MidLetter          = [\p{Word_Break = MidLetter} - [\: \uFE55 \uFF1A]];
MidNum             = [\p{Word_Break = MidNum}];
Numeric            = [\p{Word_Break = Numeric}];
ExtendNumLet       = [\p{Word_Break = ExtendNumLet}];
WSegSpace          = [\p{Word_Break = WSegSpace}];
Extended_Pict      = [:ExtPict:];

#define dictionary, with the effect being that those characters don't appear in test data.

Hiragana       = [:Hiragana:];

Control        = [\p{Grapheme_Cluster_Break = Control}];
HangulSyllable = [\uac00-\ud7a3];
ComplexContext = [:LineBreak = Complex_Context:];
KanaKanji      = [Han Hiragana Katakana];
dictionaryCJK  = [KanaKanji HangulSyllable];
dictionary     = [ComplexContext dictionaryCJK];

# leave dictionary scripts out of ALetter

ALetter        = [ALetter - dictionary];

AHLetter       = [ALetter  Hebrew_Letter];
MidNumLetQ     = [MidNumLet  Single_Quote];
ExtFmt         = [Extend Format ZWJ];

WB3:   CR LF;
WB3a:  (Newline | CR | LF) ÷;
WB3b:  . ÷ (Newline | CR | LF);   # actually redundant? No other rule combines.
                                  # (but needed with UAX treat-as scheme.)
WB3c:   ZWJ Extended_Pict;
WB3d:   WSegSpace WSegSpace;

WB5:    AHLetter ExtFmt* AHLetter;

# includes both WB6 and WB7
WB6:    AHLetter ExtFmt* (MidLetter | MidNumLetQ) ExtFmt*  AHLetter;

WB7a:   Hebrew_Letter ExtFmt* Single_Quote;
WB7b:   Hebrew_Letter ExtFmt* Double_Quote ExtFmt* Hebrew_Letter;   # Include WB7c

WB8:    Numeric ExtFmt* Numeric;
WB9:    AHLetter ExtFmt* Numeric;
WB10:   Numeric ExtFmt* AHLetter;

WB11:   Numeric ExtFmt* (MidNum | MidNumLetQ) ExtFmt* Numeric;    # includes WB12
WB13:   Katakana ExtFmt* Katakana;

WB13a:  (AHLetter | Numeric | Katakana | ExtendNumLet) ExtFmt* ExtendNumLet;
WB13b:  ExtendNumLet ExtFmt* (AHLetter | Numeric | Katakana);

# WB rule 15 - 17, pairs of Regional Indicators stay unbroken.
#              Interacts with WB3c.
WB15:  Regional_Indicator ExtFmt* Regional_Indicator ExtFmt* ZWJ Extended_Pict;
WB17:  Regional_Indicator ExtFmt* Regional_Indicator ExtFmt* ÷;

# Rule WB 999   Any ÷ Any
#    Interacts with WB3c, do not break between ZWJ and (Extended_Pict | EBG).
WB999.1: . ExtFmt* ZWJ Extended_Pict;
WB999.2: . ExtFmt* ÷;