twitter_cldr 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -0
- data/History.txt +5 -0
- data/js/lib/twitter_cldr_js.rb +2 -0
- data/lib/twitter_cldr/collation/collator.rb +8 -3
- data/lib/twitter_cldr/collation/sort_key_builder.rb +118 -34
- data/lib/twitter_cldr/collation/trie_builder.rb +5 -1
- data/lib/twitter_cldr/resources/import/tailoring.rb +14 -5
- data/lib/twitter_cldr/version.rb +1 -1
- data/resources/collation/tailoring/af.yml +1 -0
- data/resources/collation/tailoring/ar.yml +1 -0
- data/resources/collation/tailoring/ca.yml +1 -0
- data/resources/collation/tailoring/cs.yml +1 -0
- data/resources/collation/tailoring/da.yml +2 -0
- data/resources/collation/tailoring/de.yml +1 -0
- data/resources/collation/tailoring/el.yml +1 -0
- data/resources/collation/tailoring/en.yml +1 -0
- data/resources/collation/tailoring/es.yml +1 -0
- data/resources/collation/tailoring/eu.yml +1 -0
- data/resources/collation/tailoring/fa.yml +1 -0
- data/resources/collation/tailoring/fi.yml +1 -0
- data/resources/collation/tailoring/fil.yml +1 -0
- data/resources/collation/tailoring/fr.yml +1 -0
- data/resources/collation/tailoring/he.yml +1 -0
- data/resources/collation/tailoring/hi.yml +1 -0
- data/resources/collation/tailoring/hu.yml +1 -0
- data/resources/collation/tailoring/id.yml +1 -0
- data/resources/collation/tailoring/it.yml +1 -0
- data/resources/collation/tailoring/ja.yml +1 -0
- data/resources/collation/tailoring/ko.yml +1 -0
- data/resources/collation/tailoring/ms.yml +1 -0
- data/resources/collation/tailoring/nb.yml +1 -0
- data/resources/collation/tailoring/nl.yml +1 -0
- data/resources/collation/tailoring/pl.yml +1 -0
- data/resources/collation/tailoring/pt.yml +1 -0
- data/resources/collation/tailoring/ru.yml +1 -0
- data/resources/collation/tailoring/sv.yml +1 -0
- data/resources/collation/tailoring/th.yml +1 -0
- data/resources/collation/tailoring/tr.yml +1 -0
- data/resources/collation/tailoring/uk.yml +1 -0
- data/resources/collation/tailoring/ur.yml +1 -0
- data/resources/collation/tailoring/zh-Hant.yml +1 -0
- data/resources/collation/tailoring/zh.yml +1 -0
- data/spec/collation/collator_spec.rb +118 -16
- data/spec/collation/sort_key_builder_spec.rb +79 -25
- data/spec/collation/tailoring_spec.rb +0 -76
- data/spec/collation/tailoring_tests/da.txt +181 -181
- data/spec/collation/trie_builder_spec.rb +26 -12
- metadata +3 -3
@@ -1,293 +1,293 @@
|
|
1
1
|
# Pending: 'caseFirst="upper"' is not supported (http://unicode.org/cldr/trac/browser/tags/release-21/common/collation/da.xml#L176).
|
2
2
|
|
3
|
-
|
3
|
+
X
|
4
4
|
x
|
5
5
|
x x
|
6
|
-
|
6
|
+
X.
|
7
7
|
x.
|
8
8
|
x.x
|
9
|
-
|
9
|
+
X0
|
10
10
|
x0
|
11
11
|
x0x
|
12
|
-
|
12
|
+
X12
|
13
13
|
x12
|
14
14
|
x12x
|
15
|
-
|
15
|
+
X2
|
16
16
|
x2
|
17
17
|
x2x
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
XA
|
19
|
+
Xa
|
20
|
+
xA
|
21
21
|
xa
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
XÁ
|
23
|
+
Xá
|
24
|
+
xÁ
|
25
25
|
xá
|
26
|
-
|
26
|
+
xAx
|
27
27
|
xax
|
28
|
-
|
28
|
+
xÁx
|
29
29
|
xáx
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
XB
|
31
|
+
Xb
|
32
|
+
xB
|
33
33
|
xb
|
34
|
-
|
34
|
+
xBx
|
35
35
|
xbx
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
XC
|
37
|
+
Xc
|
38
|
+
xC
|
39
39
|
xc
|
40
|
-
|
40
|
+
xCx
|
41
41
|
xcx
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
XD
|
43
|
+
Xd
|
44
|
+
xD
|
45
45
|
xd
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
XĐ
|
47
|
+
Xđ
|
48
|
+
xĐ
|
49
49
|
xđ
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
XÐ
|
51
|
+
Xð
|
52
|
+
xÐ
|
53
53
|
xð
|
54
|
-
|
54
|
+
xDx
|
55
55
|
xdx
|
56
|
-
|
56
|
+
xĐx
|
57
57
|
xđx
|
58
|
-
|
58
|
+
xÐx
|
59
59
|
xðx
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
XE
|
61
|
+
Xe
|
62
|
+
xE
|
63
63
|
xe
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
XÉ
|
65
|
+
Xé
|
66
|
+
xÉ
|
67
67
|
xé
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
XÈ
|
69
|
+
Xè
|
70
|
+
xÈ
|
71
71
|
xè
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
XÊ
|
73
|
+
Xê
|
74
|
+
xÊ
|
75
75
|
xê
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
XË
|
77
|
+
Xë
|
78
|
+
xË
|
79
79
|
xë
|
80
|
-
|
80
|
+
xEx
|
81
81
|
xex
|
82
|
-
|
82
|
+
xÉx
|
83
83
|
xéx
|
84
|
-
|
84
|
+
xÈx
|
85
85
|
xèx
|
86
|
-
|
86
|
+
xÊx
|
87
87
|
xêx
|
88
|
-
|
88
|
+
xËx
|
89
89
|
xëx
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
XF
|
91
|
+
Xf
|
92
|
+
xF
|
93
93
|
xf
|
94
|
-
|
94
|
+
xFx
|
95
95
|
xfx
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
XG
|
97
|
+
Xg
|
98
|
+
xG
|
99
99
|
xg
|
100
|
-
|
100
|
+
xGx
|
101
101
|
xgx
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
XH
|
103
|
+
Xh
|
104
|
+
xH
|
105
105
|
xh
|
106
|
-
|
106
|
+
xHx
|
107
107
|
xhx
|
108
|
-
|
109
|
-
|
110
|
-
|
108
|
+
XI
|
109
|
+
Xi
|
110
|
+
xI
|
111
111
|
xi
|
112
|
-
|
112
|
+
xIx
|
113
113
|
xix
|
114
|
-
|
115
|
-
|
116
|
-
|
114
|
+
XJ
|
115
|
+
Xj
|
116
|
+
xJ
|
117
117
|
xj
|
118
|
-
|
118
|
+
xJx
|
119
119
|
xjx
|
120
|
-
|
121
|
-
|
122
|
-
|
120
|
+
XK
|
121
|
+
Xk
|
122
|
+
xK
|
123
123
|
xk
|
124
|
-
|
124
|
+
xKx
|
125
125
|
xkx
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
XL
|
127
|
+
Xl
|
128
|
+
xL
|
129
129
|
xl
|
130
|
-
|
130
|
+
xLx
|
131
131
|
xlx
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
XM
|
133
|
+
Xm
|
134
|
+
xM
|
135
135
|
xm
|
136
|
-
|
136
|
+
xMx
|
137
137
|
xmx
|
138
|
-
|
139
|
-
|
140
|
-
|
138
|
+
XN
|
139
|
+
Xn
|
140
|
+
xN
|
141
141
|
xn
|
142
|
-
|
142
|
+
xNx
|
143
143
|
xnx
|
144
|
-
|
145
|
-
|
146
|
-
|
144
|
+
XO
|
145
|
+
Xo
|
146
|
+
xO
|
147
147
|
xo
|
148
|
-
|
148
|
+
xOx
|
149
149
|
xox
|
150
|
-
|
151
|
-
|
152
|
-
|
150
|
+
XP
|
151
|
+
Xp
|
152
|
+
xP
|
153
153
|
xp
|
154
|
-
|
154
|
+
xPx
|
155
155
|
xpx
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
XQ
|
157
|
+
Xq
|
158
|
+
xQ
|
159
159
|
xq
|
160
|
-
|
160
|
+
xQx
|
161
161
|
xqx
|
162
|
-
|
163
|
-
|
164
|
-
|
162
|
+
XR
|
163
|
+
Xr
|
164
|
+
xR
|
165
165
|
xr
|
166
|
-
|
166
|
+
xRx
|
167
167
|
xrx
|
168
|
-
|
169
|
-
|
170
|
-
|
168
|
+
XS
|
169
|
+
Xs
|
170
|
+
xS
|
171
171
|
xs
|
172
|
-
|
172
|
+
xSx
|
173
173
|
xsx
|
174
|
-
|
175
|
-
|
176
|
-
|
174
|
+
XT
|
175
|
+
Xt
|
176
|
+
xT
|
177
177
|
xt
|
178
|
-
|
179
|
-
|
180
|
-
|
178
|
+
XÞ
|
179
|
+
Xþ
|
180
|
+
xÞ
|
181
181
|
xþ
|
182
|
-
|
182
|
+
xÞx
|
183
183
|
xþx
|
184
|
-
|
184
|
+
xTx
|
185
185
|
xtx
|
186
|
-
|
187
|
-
|
188
|
-
|
186
|
+
XU
|
187
|
+
Xu
|
188
|
+
xU
|
189
189
|
xu
|
190
|
-
|
190
|
+
xUx
|
191
191
|
xux
|
192
|
-
|
193
|
-
|
194
|
-
|
192
|
+
XV
|
193
|
+
Xv
|
194
|
+
xV
|
195
195
|
xv
|
196
|
-
|
196
|
+
xVx
|
197
197
|
xvx
|
198
|
-
|
199
|
-
|
200
|
-
|
198
|
+
XW
|
199
|
+
Xw
|
200
|
+
xW
|
201
201
|
xw
|
202
|
-
|
202
|
+
xWx
|
203
203
|
xwx
|
204
|
-
|
205
|
-
|
206
|
-
|
204
|
+
XX
|
205
|
+
Xx
|
206
|
+
xX
|
207
207
|
xx
|
208
|
-
|
208
|
+
xXx
|
209
209
|
xxx
|
210
|
-
|
211
|
-
|
212
|
-
|
210
|
+
XY
|
211
|
+
Xy
|
212
|
+
xY
|
213
213
|
xy
|
214
|
-
|
215
|
-
|
216
|
-
|
214
|
+
XÜ
|
215
|
+
Xü
|
216
|
+
xÜ
|
217
217
|
xü
|
218
|
-
|
219
|
-
|
220
|
-
|
218
|
+
XŰ
|
219
|
+
Xű
|
220
|
+
xŰ
|
221
221
|
xű
|
222
|
-
|
222
|
+
xYx
|
223
223
|
xyx
|
224
|
-
|
224
|
+
xÜx
|
225
225
|
xüx
|
226
|
-
|
226
|
+
xŰx
|
227
227
|
xűx
|
228
|
-
|
229
|
-
|
230
|
-
|
228
|
+
XZ
|
229
|
+
Xz
|
230
|
+
xZ
|
231
231
|
xz
|
232
|
-
|
232
|
+
xZx
|
233
233
|
xzx
|
234
|
-
|
235
|
-
|
236
|
-
|
234
|
+
XÆ
|
235
|
+
Xæ
|
236
|
+
xÆ
|
237
237
|
xæ
|
238
|
-
|
239
|
-
|
240
|
-
|
238
|
+
XÄ
|
239
|
+
Xä
|
240
|
+
xÄ
|
241
241
|
xä
|
242
|
-
|
243
|
-
|
244
|
-
|
242
|
+
XĘ
|
243
|
+
Xę
|
244
|
+
xĘ
|
245
245
|
xę
|
246
|
-
|
246
|
+
xÆx
|
247
247
|
xæx
|
248
|
-
|
248
|
+
xÄx
|
249
249
|
xäx
|
250
|
-
|
250
|
+
xĘx
|
251
251
|
xęx
|
252
|
-
|
253
|
-
|
254
|
-
|
252
|
+
XØ
|
253
|
+
Xø
|
254
|
+
xØ
|
255
255
|
xø
|
256
|
-
|
257
|
-
|
258
|
-
|
256
|
+
XÖ
|
257
|
+
Xö
|
258
|
+
xÖ
|
259
259
|
xö
|
260
|
-
|
261
|
-
|
262
|
-
|
260
|
+
XŐ
|
261
|
+
Xő
|
262
|
+
xŐ
|
263
263
|
xő
|
264
|
-
|
265
|
-
|
266
|
-
|
264
|
+
XŒ
|
265
|
+
Xœ
|
266
|
+
xŒ
|
267
267
|
xœ
|
268
|
-
|
268
|
+
xØx
|
269
269
|
xøx
|
270
|
-
|
270
|
+
xÖx
|
271
271
|
xöx
|
272
|
-
|
272
|
+
xŐx
|
273
273
|
xőx
|
274
|
-
|
274
|
+
xŒx
|
275
275
|
xœx
|
276
276
|
XÅ
|
277
277
|
// XAA
|
278
278
|
XaA
|
279
|
-
|
279
|
+
XAa
|
280
280
|
Xå
|
281
|
-
|
281
|
+
Xaa
|
282
282
|
xÅ
|
283
283
|
// xAA
|
284
284
|
xaA
|
285
|
-
|
285
|
+
xAa
|
286
286
|
xå
|
287
287
|
xaa
|
288
288
|
xÅx
|
289
289
|
// xAAx
|
290
290
|
xaAx
|
291
|
-
|
291
|
+
xAax
|
292
292
|
xåx
|
293
293
|
xaax
|
@@ -9,7 +9,7 @@ include TwitterCldr::Collation
|
|
9
9
|
|
10
10
|
describe TrieBuilder do
|
11
11
|
|
12
|
-
describe '
|
12
|
+
describe '.parse_trie' do
|
13
13
|
it 'returns a trie' do
|
14
14
|
TrieBuilder.parse_trie(fractional_uca_short_stub).should be_instance_of(Trie)
|
15
15
|
end
|
@@ -104,7 +104,7 @@ END
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
describe '
|
107
|
+
describe '.load_trie' do
|
108
108
|
it 'load FCE table from the resource into a trie' do
|
109
109
|
mock(TrieBuilder).parse_trie('fce-table') { 'trie' }
|
110
110
|
mock(TrieBuilder).load_resource('resource') { 'fce-table' }
|
@@ -113,12 +113,27 @@ END
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
|
116
|
+
let(:tailoring_resource_stub) do
|
117
|
+
<<END
|
118
|
+
---
|
119
|
+
collator_options:
|
120
|
+
case_first: upper
|
121
|
+
tailored_table: ! '0491; [5C1B, 5, 5]
|
122
|
+
|
123
|
+
0490; [5C1B, 5, 86]'
|
124
|
+
suppressed_contractions: ГК
|
125
|
+
...
|
126
|
+
END
|
127
|
+
end
|
128
|
+
|
129
|
+
let(:tailoring_data) { TwitterCldr::Utils.deep_symbolize_keys(YAML.load(tailoring_resource_stub)) }
|
130
|
+
|
131
|
+
describe '.load_tailored_trie' do
|
117
132
|
let(:locale) { :xxx }
|
118
133
|
let(:fallback) { TrieBuilder.parse_trie(fractional_uca_short_stub) }
|
119
134
|
let(:tailored_trie) { TrieBuilder.load_tailored_trie(locale, fallback) }
|
120
135
|
|
121
|
-
before(:each) { mock(
|
136
|
+
before(:each) { mock(TrieBuilder).tailoring_data(locale) { tailoring_data } }
|
122
137
|
|
123
138
|
it 'returns a TrieWithFallback' do
|
124
139
|
tailored_trie.should be_instance_of(TrieWithFallback)
|
@@ -179,15 +194,14 @@ END
|
|
179
194
|
END
|
180
195
|
end
|
181
196
|
|
182
|
-
|
183
|
-
<<END
|
184
|
-
---
|
185
|
-
:tailored_table: ! '0491; [5C1B, 5, 5]
|
197
|
+
end
|
186
198
|
|
187
|
-
|
188
|
-
:
|
189
|
-
|
190
|
-
|
199
|
+
describe '.tailoring_data' do
|
200
|
+
let(:locale) { :fu }
|
201
|
+
|
202
|
+
it 'loads tailoring data' do
|
203
|
+
mock(TwitterCldr).get_resource(:collation, :tailoring, locale) { tailoring_data }
|
204
|
+
TrieBuilder.tailoring_data(locale).should == tailoring_data
|
191
205
|
end
|
192
206
|
end
|
193
207
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_cldr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 1.6.
|
9
|
+
- 1
|
10
|
+
version: 1.6.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Cameron Dutro
|