]>
Commit | Line | Data |
---|---|---|
0f5d89e8 A |
1 | ## wordNLLTu8.txt\r |
2 | ## The following corresponds to source file from CoreLP of 2018-Jan-17:\r | |
3 | ## CoreNLP/Tagger.subproj/Tagger.subproj/Source/Tagging/Data/word.txt\r | |
4 | ## and binary files in CoreLP of 2018-Feb-03:\r | |
5 | ## CoreNLP.framework/Resources/word.dat [for ICU before 60, including ICU 57]\r | |
6 | ## CoreNLP.framework/Resources/word_icu60.dat\r | |
7 | ##############################################################################\r | |
8 | #\r | |
9 | # Copyright (C) 2002-2016, International Business Machines Corporation\r | |
10 | # and others. All Rights Reserved.\r | |
11 | #\r | |
12 | # file: word.txt\r | |
13 | #\r | |
14 | # ICU Word Break Rules\r | |
15 | # See Unicode Standard Annex #29.\r | |
16 | # These rules are based on UAX #29 Revision 27 for Unicode Version 8.0\r | |
17 | # with additions from L2/16-011R3 for Emoji sequences.\r | |
18 | #\r | |
19 | # Note: Updates to word.txt will usually need to be merged into\r | |
20 | # word_POSIX.txt also.\r | |
21 | \r | |
22 | ##############################################################################\r | |
23 | #\r | |
24 | # Character class definitions from TR 29\r | |
25 | #\r | |
26 | ##############################################################################\r | |
27 | \r | |
28 | !!chain;\r | |
29 | \r | |
30 | \r | |
31 | # Smart Tokenizer customization\r | |
32 | $Space = [\u0020];\r | |
33 | $Fullstop = [\u002E\uFE52\uFF0E];\r | |
34 | $Dash = [\u002D\uFE63\uFF0D];\r | |
35 | \r | |
36 | $Terminators = [\u0021\u00A1\u00A1\u01C3\u01C3\u01C3\u203C\u2048\uFE15\uFF01\u003F];\r | |
37 | $Parenthesis = [\u0028\u005B\u007B\u0029\u005D\u007D];\r | |
38 | $Punctuation = [\u007E\u003D\u002A\u003C\u003E];\r | |
39 | $OtherSingle = [\u0060\u0300\u030F];\r | |
40 | \r | |
41 | $Hash = [\u0023 \uFE5F \uFF03];\r | |
42 | $At = [\u0040 \uFE6B \uFF20];\r | |
43 | $Dollar = [\u0024];\r | |
44 | \r | |
45 | $Semicolon = [\u003B];\r | |
46 | $Colon = [\u003A];\r | |
47 | \r | |
48 | #\r | |
49 | # Character Class Definitions.\r | |
50 | #\r | |
51 | \r | |
52 | $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];\r | |
53 | $E_Modifier = [\U0001F3FB-\U0001F3FF];\r | |
54 | $ZWJ = [\u200D];\r | |
55 | $GAZ = [\U0001F466-\U0001F469\U0001F48B\U0001F5E8\u2764];\r | |
56 | \r | |
57 | $CR = [\p{Word_Break = CR}];\r | |
58 | $LF = [\p{Word_Break = LF}];\r | |
59 | $Newline = [\p{Word_Break = Newline} ];\r | |
60 | $Extend = [[\p{Word_Break = Extend}][:Block=Tags:]];\r | |
61 | $Regional_Indicator = [\p{Word_Break = Regional_Indicator}];\r | |
62 | $Format = [[\p{Word_Break = Format}] - [:Block=Tags:]];\r | |
63 | $Katakana = [\p{Word_Break = Katakana}];\r | |
64 | $Hebrew_Letter = [\p{Word_Break = Hebrew_Letter}];\r | |
65 | $ALetter = [\p{Word_Break = ALetter}];\r | |
66 | $Single_Quote = [\p{Word_Break = Single_Quote}\u2018\u2019];\r | |
67 | $Double_Quote = [\p{Word_Break = Double_Quote}];\r | |
68 | $MidNumLet = [\p{Word_Break = MidNumLet}-[$Fullstop $Single_Quote]];\r | |
69 | $MidLetter = [\p{Word_Break = MidLetter}-[$Single_Quote]];\r | |
70 | $MidNum = [\p{Word_Break = MidNum}];\r | |
71 | $Numeric = [\p{Word_Break = Numeric}];\r | |
72 | $ExtendNumLet = [\p{Word_Break = ExtendNumLet}];\r | |
73 | \r | |
74 | $Han = [:Han:];\r | |
75 | $Hiragana = [:Hiragana:];\r | |
76 | \r | |
77 | \r | |
78 | # Dictionary character set, for triggering language-based break engines. Currently\r | |
79 | # limited to LineBreak=Complex_Context. Note that this set only works in Unicode\r | |
80 | # 5.0 or later as the definition of Complex_Context was corrected to include all\r | |
81 | # characters requiring dictionary break.\r | |
82 | \r | |
83 | $Control = [\p{Grapheme_Cluster_Break = Control}];\r | |
84 | $HangulSyllable = [\uac00-\ud7a3];\r | |
85 | $ComplexContext = [:LineBreak = Complex_Context:];\r | |
86 | $KanaKanji = [$Han $Hiragana $Katakana];\r | |
87 | $dictionaryCJK = [$KanaKanji $HangulSyllable];\r | |
88 | $dictionary = [$ComplexContext $dictionaryCJK];\r | |
89 | \r | |
90 | # leave CJK scripts out of ALetterPlus\r | |
91 | $ALetterPlus = [$ALetter-$dictionaryCJK [$ComplexContext-$Extend-$Control]];\r | |
92 | \r | |
93 | #\r | |
94 | # Rules 4 Ignore Format and Extend characters,\r | |
95 | # except when they appear at the beginning of a region of text.\r | |
96 | #\r | |
97 | # TODO: check if handling of katakana in dictionary makes rules incorrect/void\r | |
98 | $KatakanaEx = $Katakana ($Extend | $Format | $ZWJ)*;\r | |
99 | $Hebrew_LetterEx = $Hebrew_Letter ($Extend | $Format | $ZWJ)*;\r | |
100 | $ALetterEx = $ALetterPlus ($Extend | $Format | $ZWJ)*;\r | |
101 | $Single_QuoteEx = $Single_Quote ($Extend | $Format | $ZWJ)*;\r | |
102 | $Double_QuoteEx = $Double_Quote ($Extend | $Format | $ZWJ)*;\r | |
103 | $MidNumLetEx = $MidNumLet ($Extend | $Format | $ZWJ)*;\r | |
104 | $MidLetterEx = $MidLetter ($Extend | $Format | $ZWJ)*;\r | |
105 | $MidNumEx = $MidNum ($Extend | $Format | $ZWJ)*;\r | |
106 | $NumericEx = $Numeric ($Extend | $Format | $ZWJ)*;\r | |
107 | $ExtendNumLetEx = $ExtendNumLet ($Extend | $Format | $ZWJ)*;\r | |
108 | $Regional_IndicatorEx = $Regional_Indicator ($Extend | $Format | $ZWJ)*;\r | |
109 | \r | |
110 | $Ideographic = [\p{Ideographic}];\r | |
111 | $HiraganaEx = $Hiragana ($Extend | $Format | $ZWJ)*;\r | |
112 | $IdeographicEx = $Ideographic ($Extend | $Format | $ZWJ)*;\r | |
113 | \r | |
114 | $Letter = [A-Za-z];\r | |
115 | \r | |
116 | $Contraction = (N | n) $Single_Quote (T | t);\r | |
117 | $Yall = (Y | y) $Single_Quote (A | a) (L | l)*;\r | |
118 | \r | |
119 | $Time = (0 | 1 | 2)? $Numeric $Colon (0 | 1 | 2 | 3 | 4 | 5) $Numeric;\r | |
120 | #$IPAddress = $Numeric? $Numeric? $Numeric $Fullstop $Numeric? $Numeric? $Numeric $Fullstop $Numeric? $Numeric? $Numeric $Fullstop $Numeric? $Numeric? $Numeric;\r | |
121 | $IPAddress = $Numeric? $Numeric? $Numeric $Fullstop $Numeric? $Numeric? $Numeric;\r | |
122 | \r | |
123 | ## -------------------------------------------------\r | |
124 | \r | |
125 | !!forward;\r | |
126 | \r | |
127 | $Space* {0};\r | |
128 | \r | |
129 | $Contraction {202};\r | |
130 | $Yall {202};\r | |
131 | \r | |
132 | $Fullstop {20};\r | |
133 | $Dash {21};\r | |
134 | $Single_Quote {22};\r | |
135 | \r | |
136 | $Fullstop $Fullstop ($Fullstop*) {40};\r | |
137 | $Dash $Dash ($Dash*) {40};\r | |
138 | $Terminators $Terminators ($Terminators*) {40};\r | |
139 | $Punctuation $Punctuation ($Punctuation*) {40};\r | |
140 | $OtherSingle $OtherSingle ($OtherSingle*) {40};\r | |
141 | \r | |
142 | $Single_Quote $Single_Quote {40};\r | |
143 | $Single_Quote $Single_Quote $Single_Quote* {40};\r | |
144 | \r | |
145 | $Hash ($ALetter | $Numeric)* {30};\r | |
146 | $At ($ALetter | $Numeric)* {31};\r | |
147 | $Dollar $ALetter ($ALetter | $Numeric)* {31};\r | |
148 | \r | |
149 | $Time {50};\r | |
150 | $IPAddress {51};\r | |
151 | \r | |
152 | $ALetter / $IPAddress;\r | |
153 | $ALetter / $Time;\r | |
154 | \r | |
155 | $IPAddress / $ALetter;\r | |
156 | $Time / $ALetter;\r | |
157 | \r | |
158 | ($Colon | $Semicolon) $Parenthesis {32};\r | |
159 | \r | |
160 | $Fullstop $Numeric $Numeric;\r | |
161 | \r | |
162 | # Rule 3 - CR x LF\r | |
163 | #\r | |
164 | $CR $LF;\r | |
165 | \r | |
166 | # Rule 3c ZWJ x GAZ. Preceeds WB4, so no intervening Extend chars allowed.\r | |
167 | #\r | |
168 | $ZWJ $GAZ;\r | |
169 | \r | |
170 | \r | |
171 | # Rule 4 - ignore Format and Extend characters, except when they appear at the beginning\r | |
172 | # of a region of Text. The rule here comes into play when the start of text\r | |
173 | # begins with a group of Format chars, or with a "word" consisting of a single\r | |
174 | # char that is not in any of the listed word break categories followed by\r | |
175 | # format char(s), or is not a CJK dictionary character.\r | |
176 | [^$CR $LF $Newline]? ($Extend | $Format | $ZWJ)+;\r | |
177 | \r | |
178 | $NumericEx {100};\r | |
179 | $ALetterEx {200};\r | |
180 | $HangulSyllable {200};\r | |
181 | $Hebrew_LetterEx{200};\r | |
182 | $KatakanaEx {400}; # note: these status values override those from rule 5\r | |
183 | $HiraganaEx {400}; # by virtue of being numerically larger.\r | |
184 | $IdeographicEx {400}; #\r | |
185 | \r | |
186 | $E_Base ($Extend | $Format | $ZWJ)*;\r | |
187 | $E_Modifier ($Extend | $Format | $ZWJ)*;\r | |
188 | $GAZ ($Extend | $Format | $ZWJ)*;\r | |
189 | \r | |
190 | #\r | |
191 | # rule 5\r | |
192 | # Do not break between most letters.\r | |
193 | #\r | |
194 | ($ALetterEx | $Hebrew_LetterEx) ($ALetterEx | $Hebrew_LetterEx) {200};\r | |
195 | \r | |
196 | # rule 6 and 7\r | |
197 | #($ALetterEx | $Hebrew_LetterEx) ($MidLetterEx | $MidNumLetEx | $Single_QuoteEx) ($ALetterEx | $Hebrew_LetterEx) {200};\r | |
198 | ($ALetterEx | $Hebrew_LetterEx) ($MidLetterEx | $MidNumLetEx) ($ALetterEx | $Hebrew_LetterEx) {200};\r | |
199 | \r | |
200 | # rule 7a\r | |
201 | #$Hebrew_LetterEx $Single_QuoteEx {200};\r | |
202 | \r | |
203 | # rule 7b and 7c\r | |
204 | $Hebrew_LetterEx $Double_QuoteEx $Hebrew_LetterEx {200};\r | |
205 | \r | |
206 | # rule 8\r | |
207 | \r | |
208 | $NumericEx $NumericEx {100};\r | |
209 | \r | |
210 | # rule 9\r | |
211 | \r | |
212 | ($ALetterEx | $Hebrew_LetterEx) $NumericEx {200};\r | |
213 | \r | |
214 | # rule 10\r | |
215 | \r | |
216 | $NumericEx ($ALetterEx | $Hebrew_LetterEx) {200};\r | |
217 | \r | |
218 | # rule 11 and 12\r | |
219 | \r | |
220 | $NumericEx ($MidNumEx | $MidNumLetEx | $Single_QuoteEx) $NumericEx {100};\r | |
221 | \r | |
222 | # rule 13\r | |
223 | # to be consistent with $KanaKanji $KanaKanhi, changed\r | |
224 | # from 300 to 400.\r | |
225 | # See also TestRuleStatus in intltest/rbbiapts.cpp\r | |
226 | $KatakanaEx $KatakanaEx {400};\r | |
227 | \r | |
228 | # rule 13a/b\r | |
229 | \r | |
230 | $ALetterEx $ExtendNumLetEx {200}; # (13a)\r | |
231 | $Hebrew_LetterEx $ExtendNumLetEx {200}; # (13a)\r | |
232 | $NumericEx $ExtendNumLetEx {100}; # (13a)\r | |
233 | $KatakanaEx $ExtendNumLetEx {400}; # (13a)\r | |
234 | $ExtendNumLetEx $ExtendNumLetEx {200}; # (13a)\r | |
235 | \r | |
236 | $ExtendNumLetEx $ALetterEx {200}; # (13b)\r | |
237 | $ExtendNumLetEx $Hebrew_Letter {200}; # (13b)\r | |
238 | $ExtendNumLetEx $NumericEx {100}; # (13b)\r | |
239 | $ExtendNumLetEx $KatakanaEx {400}; # (13b)\r | |
240 | \r | |
241 | # rule 13c\r | |
242 | # Pairs of Regional Indicators stay together.\r | |
243 | # With rule chaining disabled by ^, this rule will match exactly two of them.\r | |
244 | # No other rule begins with a Regional_Indicator, so chaining cannot extend the match.\r | |
245 | #\r | |
246 | ^$Regional_IndicatorEx $Regional_IndicatorEx;\r | |
247 | \r | |
248 | # special handling for CJK characters: chain for later dictionary segmentation\r | |
249 | $HangulSyllable $HangulSyllable {200};\r | |
250 | $KanaKanji $KanaKanji {400}; # different rule status if both kana and kanji found\r | |
251 | \r | |
252 | # rule 13d\r | |
253 | # E_Base x E_Modifier\r | |
254 | #\r | |
255 | ($E_Base | $GAZ) ($Format | $Extend | $ZWJ)* $E_Modifier;\r | |
256 | \r | |
257 | ## -------------------------------------------------\r | |
258 | \r | |
259 | !!reverse;\r | |
260 | \r | |
261 | $BackHebrew_LetterEx = ($Format | $Extend | $ZWJ)* $Hebrew_Letter;\r | |
262 | $BackALetterEx = ($Format | $Extend | $ZWJ)* $ALetterPlus;\r | |
263 | $BackSingle_QuoteEx = ($Format | $Extend | $ZWJ)* $Single_Quote;\r | |
264 | $BackDouble_QuoteEx = ($Format | $Extend | $ZWJ)* $Double_Quote;\r | |
265 | $BackMidNumLetEx = ($Format | $Extend | $ZWJ)* $MidNumLet;\r | |
266 | $BackNumericEx = ($Format | $Extend | $ZWJ)* $Numeric;\r | |
267 | $BackMidNumEx = ($Format | $Extend | $ZWJ)* $MidNum;\r | |
268 | $BackMidLetterEx = ($Format | $Extend | $ZWJ)* $MidLetter;\r | |
269 | $BackKatakanaEx = ($Format | $Extend | $ZWJ)* $Katakana;\r | |
270 | $BackHiraganaEx = ($Format | $Extend | $ZWJ)* $Hiragana;\r | |
271 | $BackExtendNumLetEx = ($Format | $Extend | $ZWJ)* $ExtendNumLet;\r | |
272 | $BackRegional_IndicatorEx = ($Format | $Extend | $ZWJ)* $Regional_Indicator;\r | |
273 | \r | |
274 | # rule 3\r | |
275 | $LF $CR;\r | |
276 | \r | |
277 | # Rule 3c ZWJ x GAZ. Preceeds WB4, so no intervening Extend chars allowed.\r | |
278 | #\r | |
279 | $GAZ $ZWJ;\r | |
280 | \r | |
281 | # rule 4\r | |
282 | ($Format | $Extend | $ZWJ)* [^$CR $LF $Newline]?;\r | |
283 | \r | |
284 | # rule 5\r | |
285 | \r | |
286 | ($BackALetterEx | $BackHebrew_LetterEx) ($BackALetterEx | $BackHebrew_LetterEx);\r | |
287 | \r | |
288 | # rule 6 and 7\r | |
289 | \r | |
290 | #($BackALetterEx | $BackHebrew_LetterEx) ($BackMidLetterEx | $BackMidNumLetEx | $BackSingle_QuoteEx) ($BackALetterEx | $BackHebrew_LetterEx);\r | |
291 | ($BackALetterEx | $BackHebrew_LetterEx) ($BackMidLetterEx | $BackMidNumLetEx) ($BackALetterEx | $BackHebrew_LetterEx);\r | |
292 | \r | |
293 | # rule 7a\r | |
294 | #$BackSingle_QuoteEx $BackHebrew_LetterEx;\r | |
295 | \r | |
296 | # Rule 7b and 7c\r | |
297 | $BackHebrew_LetterEx $BackDouble_QuoteEx $BackHebrew_LetterEx;\r | |
298 | \r | |
299 | # rule 8\r | |
300 | \r | |
301 | $BackNumericEx $BackNumericEx;\r | |
302 | \r | |
303 | # rule 9\r | |
304 | \r | |
305 | $BackNumericEx ($BackALetterEx | $BackHebrew_LetterEx);\r | |
306 | \r | |
307 | # rule 10\r | |
308 | \r | |
309 | ($BackALetterEx | $BackHebrew_LetterEx) $BackNumericEx;\r | |
310 | \r | |
311 | # rule 11 and 12\r | |
312 | \r | |
313 | $BackNumericEx ($BackMidNumEx | $BackMidNumLetEx | $BackSingle_QuoteEx) $BackNumericEx;\r | |
314 | \r | |
315 | # rule 13\r | |
316 | \r | |
317 | $BackKatakanaEx $BackKatakanaEx;\r | |
318 | \r | |
319 | # rules 13 a/b\r | |
320 | #\r | |
321 | $BackExtendNumLetEx ($BackALetterEx | $BackHebrew_LetterEx | $BackNumericEx | $BackKatakanaEx | $BackExtendNumLetEx);\r | |
322 | ($BackALetterEx | $BackHebrew_LetterEx | $BackNumericEx | $BackKatakanaEx) $BackExtendNumLetEx;\r | |
323 | \r | |
324 | # rule 13c\r | |
325 | \r | |
326 | ^$BackRegional_IndicatorEx / ($BackRegional_IndicatorEx $BackRegional_IndicatorEx)*\r | |
327 | ($Format | $Extend | $ZWJ)* [[^$Regional_Indicator $Format $Extend $ZWJ] {eof}];\r | |
328 | ^$BackRegional_IndicatorEx $BackRegional_IndicatorEx / ($BackRegional_IndicatorEx $BackRegional_IndicatorEx)*\r | |
329 | ($Format | $Extend | $ZWJ)* [[^$Regional_Indicator $Format $Extend $ZWJ] {eof}];\r | |
330 | \r | |
331 | $GAZ $ZWJ $BackRegional_IndicatorEx / ($BackRegional_IndicatorEx $BackRegional_IndicatorEx)*\r | |
332 | ($Format | $Extend | $ZWJ)* [[^$Regional_Indicator $Format $Extend $ZWJ] {eof}];\r | |
333 | $GAZ $ZWJ $BackRegional_IndicatorEx $BackRegional_IndicatorEx / ($BackRegional_IndicatorEx $BackRegional_IndicatorEx)*\r | |
334 | ($Format | $Extend | $ZWJ)* [[^$Regional_Indicator $Format $Extend $ZWJ] {eof}];\r | |
335 | \r | |
336 | # special handling for CJK characters: chain for later dictionary segmentation\r | |
337 | $HangulSyllable $HangulSyllable;\r | |
338 | $KanaKanji $KanaKanji; #different rule status if both kanji and kana found\r | |
339 | \r | |
340 | # rule 13d\r | |
341 | \r | |
342 | $E_Modifier ($Format | $Extend | $ZWJ)* ($E_Base | $GAZ);\r | |
343 | \r | |
344 | \r | |
345 | \r | |
346 | ## -------------------------------------------------\r | |
347 | \r | |
348 | !!safe_reverse;\r | |
349 | \r | |
350 | \r | |
351 | # rule 3\r | |
352 | ($Extend | $Format | $ZWJ)+ .?;\r | |
353 | \r | |
354 | # rule 6\r | |
355 | #($MidLetter | $MidNumLet | $Single_Quote) ($BackALetterEx | $BackHebrew_LetterEx);\r | |
356 | ($MidLetter | $MidNumLet) ($BackALetterEx | $BackHebrew_LetterEx);\r | |
357 | \r | |
358 | # rule 7b\r | |
359 | $Double_Quote $BackHebrew_LetterEx;\r | |
360 | \r | |
361 | \r | |
362 | # rule 11\r | |
363 | #($MidNum | $MidNumLet | $Single_Quote) $BackNumericEx;\r | |
364 | ($MidNum | $MidNumLet) $BackNumericEx;\r | |
365 | \r | |
366 | # rule 13c\r | |
367 | $BackRegional_IndicatorEx*;\r | |
368 | \r | |
369 | # For dictionary-based break\r | |
370 | $dictionary $dictionary;\r | |
371 | \r | |
372 | ## -------------------------------------------------\r | |
373 | \r | |
374 | !!safe_forward;\r | |
375 | \r | |
376 | \r | |
377 | # rule 4\r | |
378 | ($Extend | $Format | $ZWJ)+ .?;\r | |
379 | \r | |
380 | # rule 6\r | |
381 | #($MidLetterEx | $MidNumLetEx | $Single_QuoteEx) ($ALetterEx | $Hebrew_LetterEx);\r | |
382 | ($MidLetterEx | $MidNumLetEx) ($ALetterEx | $Hebrew_LetterEx);\r | |
383 | \r | |
384 | # rule 7b\r | |
385 | $Double_QuoteEx $Hebrew_LetterEx;\r | |
386 | \r | |
387 | # rule 11\r | |
388 | #($MidNumEx | $MidNumLetEx | $Single_QuoteEx) $NumericEx;\r | |
389 | ($MidNumEx | $MidNumLetEx) $NumericEx;\r | |
390 | \r | |
391 | # rule 13c\r | |
392 | $Regional_IndicatorEx*;\r | |
393 | \r | |
394 | # For dictionary-based break\r | |
395 | $dictionary $dictionary;\r |